Skip to content

Commit

Permalink
Update: Clear tracks data when logging out (#3269)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebykat authored Nov 4, 2024
1 parent 1b16b2d commit 00a9aa1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
6 changes: 6 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [v2.23.0]

### Fixes

- Properly clear analytics cookies on logout [#3269](https://github.com/Automattic/simplenote-electron/pull/3269)

## [v2.22.2]

### Enhancements
Expand Down
12 changes: 1 addition & 11 deletions lib/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,11 @@ const clearStorage = (): Promise<void> =>
localStorage.removeItem('localQueue:note');
localStorage.removeItem('localQueue:preferences');
localStorage.removeItem('localQueue:tag');
localStorage.removeItem('simpleNote');
localStorage.removeItem('stored_user');
sessionStorage.clear();
window.electron?.send('appStateUpdate', {});

const settings = localStorage.getItem('simpleNote');
if (settings) {
try {
const { accountName, ...otherSettings } = JSON.parse(settings);
localStorage.setItem('simpleNote', JSON.stringify(otherSettings));
} catch (e) {
// pass - we only care if we can successfully do this,
// not if we fail to do it
}
}

Promise.all([
new Promise((resolve) => {
const r = indexedDB.deleteDatabase('ghost');
Expand Down
1 change: 1 addition & 0 deletions lib/state/analytics/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export const middleware: S.Middleware = (store) => {
break;
case 'LOGOUT':
record('user_signed_out');
analytics.clearedIdentity();
break;
case 'OPEN_NOTE':
record('list_note_opened');
Expand Down

0 comments on commit 00a9aa1

Please sign in to comment.