dce-reactkit 3.6.13 → 3.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +10 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/AppWrapper.d.ts +1 -1
- package/dist/cjs/types/helpers/prefixWithAOrAn.d.ts +10 -0
- package/dist/esm/index.js +10 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/AppWrapper.d.ts +1 -1
- package/dist/esm/types/helpers/prefixWithAOrAn.d.ts +10 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/AppWrapper.tsx +10 -1
- package/src/helpers/prefixWithAOrAn.ts +29 -0
|
@@ -52,7 +52,7 @@ export declare const confirm: (title: string, text: string, opts?: {
|
|
|
52
52
|
*/
|
|
53
53
|
export declare const showFatalError: (error: any, errorTitle?: string) => Promise<void>;
|
|
54
54
|
/**
|
|
55
|
-
* Add a handler for when a fatal error occurs
|
|
55
|
+
* Add a handler for when a fatal error occurs (or when a session expiry occurs)
|
|
56
56
|
* @author Gabe Abrams
|
|
57
57
|
*/
|
|
58
58
|
export declare const addFatalErrorHandler: (handler: () => void) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefix a word or name with "a" or "an" depending on whether it starts with a
|
|
3
|
+
* vowel or not
|
|
4
|
+
* @author Gabe Abrams
|
|
5
|
+
* @param text the text to prefix
|
|
6
|
+
* @param capitalize whether to capitalize the "A" or "An"
|
|
7
|
+
* @returns the text prefixed with "a" or "an"
|
|
8
|
+
*/
|
|
9
|
+
declare const prefixWithAOrAn: (text: string, capitalize?: boolean) => string;
|
|
10
|
+
export default prefixWithAOrAn;
|
package/dist/esm/index.js
CHANGED
|
@@ -984,7 +984,7 @@ const showFatalError = (error, errorTitle = 'An Error Occurred') => __awaiter(vo
|
|
|
984
984
|
setFatalErrorTitle(errorTitle);
|
|
985
985
|
});
|
|
986
986
|
/**
|
|
987
|
-
* Add a handler for when a fatal error occurs
|
|
987
|
+
* Add a handler for when a fatal error occurs (or when a session expiry occurs)
|
|
988
988
|
* @author Gabe Abrams
|
|
989
989
|
*/
|
|
990
990
|
const addFatalErrorHandler = (handler) => {
|
|
@@ -1000,6 +1000,15 @@ let setSessionHasExpired;
|
|
|
1000
1000
|
* @author Gabe Abrams
|
|
1001
1001
|
*/
|
|
1002
1002
|
const showSessionExpiredMessage = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
1003
|
+
// Call all fatal error listeners
|
|
1004
|
+
try {
|
|
1005
|
+
fatalErrorHandlers.forEach((handler) => {
|
|
1006
|
+
handler();
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
catch (err) {
|
|
1010
|
+
// Ignore listener errors
|
|
1011
|
+
}
|
|
1003
1012
|
// Wait for helper to exist
|
|
1004
1013
|
yield waitForHelper(() => {
|
|
1005
1014
|
return !!setSessionHasExpired;
|