@atlaskit/editor-plugin-card 3.0.3 → 3.0.4
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 3.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#142271](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/142271)
|
|
8
|
+
[`b6147e8a87a2d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6147e8a87a2d) -
|
|
9
|
+
Add try/catch around localStorage usages
|
|
10
|
+
|
|
3
11
|
## 3.0.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -12,9 +12,18 @@ var LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR = exports.LOCAL_STORAGE_DISCOVERY_KEY_TO
|
|
|
12
12
|
var ONE_DAY_IN_MILLISECONDS = exports.ONE_DAY_IN_MILLISECONDS = 86400000;
|
|
13
13
|
var storageClient = new _frontendUtilities.StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
14
14
|
var isLocalStorageKeyDiscovered = exports.isLocalStorageKeyDiscovered = function isLocalStorageKeyDiscovered(key) {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
try {
|
|
16
|
+
var localStorageValue = storageClient.getItem(key);
|
|
17
|
+
return !!localStorageValue && localStorageValue === LOCAL_STORAGE_DISCOVERED_KEY;
|
|
18
|
+
} catch (_unused) {
|
|
19
|
+
// If localStorage is not available, don't show feature discovery component. Treat it as 'discovered'.
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
17
22
|
};
|
|
18
23
|
var markLocalStorageKeyDiscovered = exports.markLocalStorageKeyDiscovered = function markLocalStorageKeyDiscovered(key, expiration) {
|
|
19
|
-
|
|
24
|
+
try {
|
|
25
|
+
storageClient.setItemWithExpiry(key, LOCAL_STORAGE_DISCOVERED_KEY, expiration);
|
|
26
|
+
} catch (_unused2) {
|
|
27
|
+
// silent error
|
|
28
|
+
}
|
|
20
29
|
};
|
|
@@ -6,9 +6,18 @@ export const LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR = 'toolbar-upgrade-pulse';
|
|
|
6
6
|
export const ONE_DAY_IN_MILLISECONDS = 86400000;
|
|
7
7
|
const storageClient = new StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
8
8
|
export const isLocalStorageKeyDiscovered = key => {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
try {
|
|
10
|
+
const localStorageValue = storageClient.getItem(key);
|
|
11
|
+
return !!localStorageValue && localStorageValue === LOCAL_STORAGE_DISCOVERED_KEY;
|
|
12
|
+
} catch {
|
|
13
|
+
// If localStorage is not available, don't show feature discovery component. Treat it as 'discovered'.
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
11
16
|
};
|
|
12
17
|
export const markLocalStorageKeyDiscovered = (key, expiration) => {
|
|
13
|
-
|
|
18
|
+
try {
|
|
19
|
+
storageClient.setItemWithExpiry(key, LOCAL_STORAGE_DISCOVERED_KEY, expiration);
|
|
20
|
+
} catch {
|
|
21
|
+
// silent error
|
|
22
|
+
}
|
|
14
23
|
};
|
|
@@ -6,9 +6,18 @@ export var LOCAL_STORAGE_DISCOVERY_KEY_TOOLBAR = 'toolbar-upgrade-pulse';
|
|
|
6
6
|
export var ONE_DAY_IN_MILLISECONDS = 86400000;
|
|
7
7
|
var storageClient = new StorageClient(LOCAL_STORAGE_CLIENT_KEY);
|
|
8
8
|
export var isLocalStorageKeyDiscovered = function isLocalStorageKeyDiscovered(key) {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
try {
|
|
10
|
+
var localStorageValue = storageClient.getItem(key);
|
|
11
|
+
return !!localStorageValue && localStorageValue === LOCAL_STORAGE_DISCOVERED_KEY;
|
|
12
|
+
} catch (_unused) {
|
|
13
|
+
// If localStorage is not available, don't show feature discovery component. Treat it as 'discovered'.
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
11
16
|
};
|
|
12
17
|
export var markLocalStorageKeyDiscovered = function markLocalStorageKeyDiscovered(key, expiration) {
|
|
13
|
-
|
|
18
|
+
try {
|
|
19
|
+
storageClient.setItemWithExpiry(key, LOCAL_STORAGE_DISCOVERED_KEY, expiration);
|
|
20
|
+
} catch (_unused2) {
|
|
21
|
+
// silent error
|
|
22
|
+
}
|
|
14
23
|
};
|