blob: e556582742b85256eda8961cc15f9913b6db6d19 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import { createAlert } from '~/alert';
import AccessorUtilities from '~/lib/utils/accessor';
import { TOAST_MESSAGE_LOCALSTORAGE_KEY, TOAST_MESSAGE_SUCCESSFUL } from '../constants';
export function displaySuccessfulInvitationAlert() {
if (!AccessorUtilities.canUseLocalStorage()) {
return;
}
const showAlert = Boolean(localStorage.getItem(TOAST_MESSAGE_LOCALSTORAGE_KEY));
if (showAlert) {
localStorage.removeItem(TOAST_MESSAGE_LOCALSTORAGE_KEY);
createAlert({ message: TOAST_MESSAGE_SUCCESSFUL, variant: 'info' });
}
}
export function reloadOnInvitationSuccess() {
if (AccessorUtilities.canUseLocalStorage()) {
localStorage.setItem(TOAST_MESSAGE_LOCALSTORAGE_KEY, 'true');
}
window.location.reload();
}
|