Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import { Constants } from "@dndbeyond/character-rules-engine/es";
|
||||
|
||||
import { toastMessageActions } from "../../actions/toastMessage";
|
||||
import { StateStoreUtils } from "../../stores";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param title
|
||||
* @param message
|
||||
* @param notificationType
|
||||
*/
|
||||
export function dispatchNotification(
|
||||
title: string,
|
||||
message: string,
|
||||
notificationType: Constants.NotificationTypeEnum
|
||||
): void {
|
||||
const store = StateStoreUtils.getAppStore();
|
||||
if (store) {
|
||||
switch (notificationType) {
|
||||
case Constants.NotificationTypeEnum.ERROR:
|
||||
case Constants.NotificationTypeEnum.CRITICAL:
|
||||
store.dispatch(toastMessageActions.toastError(title, message));
|
||||
break;
|
||||
default:
|
||||
store.dispatch(toastMessageActions.toastSuccess(title, message));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param title
|
||||
* @param message
|
||||
*/
|
||||
export function dispatchSuccess(title: string, message: string): void {
|
||||
const store = StateStoreUtils.getAppStore();
|
||||
if (store) {
|
||||
store.dispatch(toastMessageActions.toastSuccess(title, message));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param title
|
||||
* @param message
|
||||
*/
|
||||
export function dispatchError(title: string, message: string): void {
|
||||
const store = StateStoreUtils.getAppStore();
|
||||
if (store) {
|
||||
store.dispatch(toastMessageActions.toastError(title, message));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user