mirror of
https://github.com/nickzuber/meteorite.git
synced 2024-08-16 23:10:38 +03:00
Simply replace clearCache with clearArchivedCache
This commit is contained in:
parent
ecd8b7ef0b
commit
b066cf43c0
@ -494,11 +494,11 @@ class NotificationsPage extends React.Component {
|
||||
fetchNotifications,
|
||||
markAllAsStaged,
|
||||
clearCache,
|
||||
clearArchivedCache,
|
||||
notificationsPermission,
|
||||
loading: isFetchingNotifications,
|
||||
error: fetchingNotificationsError,
|
||||
} = this.props.notificationsApi;
|
||||
|
||||
const {
|
||||
notifications: scoredAndSortedNotifications,
|
||||
queuedCount,
|
||||
@ -573,7 +573,6 @@ class NotificationsPage extends React.Component {
|
||||
onMarkAsRead={this.enhancedOnMarkAsRead}
|
||||
onMarkAllAsStaged={markAllAsStaged}
|
||||
onClearCache={clearCache}
|
||||
onClearArchivedCache={clearArchivedCache}
|
||||
onStageThread={this.enhancedOnStageThread}
|
||||
onRestoreThread={this.restoreThread}
|
||||
onRefreshNotifications={this.props.storageApi.refreshNotifications}
|
||||
|
@ -329,7 +329,6 @@ export default function Scene ({
|
||||
onFetchNotifications,
|
||||
onMarkAllAsStaged,
|
||||
onClearCache,
|
||||
onClearArchivedCache,
|
||||
setNotificationsPermission,
|
||||
onStageThread,
|
||||
onArchiveThread,
|
||||
@ -643,15 +642,6 @@ export default function Scene ({
|
||||
<h2>Mark all as read</h2>
|
||||
<p>Move all your unread notifications to the read tab</p>
|
||||
</optimized.div>
|
||||
<optimized.div onClick={event => {
|
||||
event.stopPropagation();
|
||||
const response = window.confirm('Are you sure you want to delete the archived section?');
|
||||
void (response && onClearArchivedCache());
|
||||
setDropdownOpen(false);
|
||||
}}>
|
||||
<h2>Empty archived</h2>
|
||||
<p>Clear all the notifications in the archived section from your local storage</p>
|
||||
</optimized.div>
|
||||
<optimized.div onClick={event => {
|
||||
event.stopPropagation();
|
||||
const response = window.confirm('Are you sure you want to clear the cache?');
|
||||
@ -659,7 +649,7 @@ export default function Scene ({
|
||||
setDropdownOpen(false);
|
||||
}}>
|
||||
<h2>Empty cache</h2>
|
||||
<p>Clear all the notifications that are being tracked in your local storage</p>
|
||||
<p>Delete all the archived notifications tracked in your local storage</p>
|
||||
</optimized.div>
|
||||
<optimized.div onClick={event => {
|
||||
event.stopPropagation();
|
||||
|
@ -487,7 +487,7 @@ const withNotificationsProvider = WrappedComponent => props => (
|
||||
setItem,
|
||||
getUserItem,
|
||||
setUserItem,
|
||||
clearCache,
|
||||
clearArchivedCache,
|
||||
removeItem
|
||||
}) => (
|
||||
<NotificationsProvider
|
||||
@ -497,7 +497,7 @@ const withNotificationsProvider = WrappedComponent => props => (
|
||||
setItemInStorage={setItem}
|
||||
getUserItem={getUserItem}
|
||||
setUserItem={setUserItem}
|
||||
clearStorageCache={clearCache}
|
||||
clearStorageCache={clearArchivedCache}
|
||||
removeItemFromStorage={removeItem}
|
||||
token={token}
|
||||
>
|
||||
|
@ -221,7 +221,7 @@ class StorageProvider extends React.Component {
|
||||
}
|
||||
|
||||
clearArchivedCache = () => {
|
||||
const notifications = Object
|
||||
Object
|
||||
.keys(window.localStorage)
|
||||
.reduce((acc, key) => {
|
||||
if (key.indexOf(LOCAL_STORAGE_PREFIX) > -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user