Skip to content
This repository was archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
Fix: TSC error TS2345
Browse files Browse the repository at this point in the history
Argument of type 'string | null' is not assignable to parameter of type 'string'
SavageCore committed Jul 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent e770874 commit 1cc427e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -4,19 +4,19 @@ const profilesKey = 'sc_profiles';
const currentProfileKey = 'sc_currentProfile';

// TODO: Remove this once all users have been migrated to the new key
let profiles = localStorage.getItem('profiles');
const currentProfile = localStorage.getItem('currentProfile');
if (profiles) {
localStorage.setItem(profilesKey, profiles);
const oldProfiles = localStorage.getItem('profiles');
const oldCurrentProfile = localStorage.getItem('currentProfile');
if (oldProfiles) {
localStorage.setItem(profilesKey, oldProfiles);
localStorage.removeItem('profiles');
}

if (currentProfile) {
localStorage.setItem(currentProfileKey, currentProfile);
if (oldCurrentProfile) {
localStorage.setItem(currentProfileKey, oldCurrentProfile);
localStorage.removeItem('currentProfile');
}

profiles = localStorage.getItem(profilesKey) || '{}';
const profiles = localStorage.getItem(profilesKey) || '{}';

const localStore = localStorage.setItem;

0 comments on commit 1cc427e

Please sign in to comment.