Skip to content

Commit

Permalink
fix account document load bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dilanx committed Jul 11, 2023
1 parent 75d4c49 commit 00a9ecd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

_2023-07-10_

- Fixed a bug where account plans and schedules may not load and activate first even if they are the most recently edited.
- Various UI updates, bug fixes, and other small changes.

### 2.6.0
Expand Down
4 changes: 3 additions & 1 deletion src/SaveDataManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { PlanData } from './types/PlanTypes';
import { ScheduleData } from './types/ScheduleTypes';
import { Mode } from './utility/Constants';
import Utility from './utility/Utility';
const d = debug('save-data-manager');

const DEFAULT_SWITCHES: ReadUserOptions = {
Expand Down Expand Up @@ -302,7 +303,8 @@ let SaveDataManager = {
if (store != null) {
if (store === 'true') val = true;
else if (store === 'false') val = false;
else if (!isNaN(parseInt(store))) val = parseInt(store);
else if (Utility.isStringEntirelyANumber(store))
val = parseInt(store);
else val = store;
}
let switchId = keys[i].substring(7) as keyof ReadUserOptions;
Expand Down
4 changes: 4 additions & 0 deletions src/utility/Utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ let Utility = {
return start_time && end_time && meeting_days;
},

isStringEntirelyANumber: (str: string) => {
return /^\d+$/.test(str);
},

friendlyEasterEgg: (text: string) => {
if (text === 'naomi') {
return ['Hmm?', "Wait what's going on?"];
Expand Down

0 comments on commit 00a9ecd

Please sign in to comment.