Skip to content

Commit

Permalink
Merge branch 'pwcSchedule1' of https://github.com/yashjagtap23/shs23
Browse files Browse the repository at this point in the history
…into pr/197
  • Loading branch information
yashjagtap23 committed Aug 7, 2023
2 parents 27f1e67 + f7ac0cc commit 71b2328
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {
methods: {
...mapActions(useScheduleStore, ['initializeSchedule', 'pageLoaded']),
...mapActions(useThemeStore, ['initializeTheme']),
...mapActions(useUserSettingsStore, ['initializeGrade']),
...mapActions(useUserSettingsStore, ['initializeGrade', 'initializeShowPWCSchedule']),
},
watch: {
theme() {
Expand All @@ -48,6 +48,7 @@ export default {
this.initializeSchedule(this.$route);
this.initializeTheme();
this.initializeGrade();
this.initializeShowPWCSchedule();
this.pageLoaded(this.$route);
document.querySelector('body').style.background = this.theme.background;
},
Expand Down
5 changes: 2 additions & 3 deletions src/stores/user-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ export default defineStore('grades', {
}
},
initializeShowPWCSchedule(): void {
if (localStorage.showPWCSchedule) {
this.setShowPWCSchedule(localStorage.showPWCSchedule === 'true');
}
console.log(localStorage.showPWCSchedule);
this.setShowPWCSchedule(localStorage.showPWCSchedule === 'true');
},
setGrade(grade: string): void {
this.grade = grade;
Expand Down
5 changes: 1 addition & 4 deletions src/views/Settings/General.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<settings-section title="General">
<div class="dropdown-row">
<span class="title">Show PWC Schedule:</span>
<dropdown class="dropdown-select" :options="['Yes', 'No']" :modelValue="selectedPWCState" @update:modelValue="updatePWCState" />
<dropdown class="dropdown-select" :options="['Yes', 'No']" :modelValue="this.showPWCSchedule ? 0 : 1" @update:modelValue="updatePWCState" />
</div>
<div class="dropdown-row">
<span class="title">Default Schedule Mode:</span>
Expand Down Expand Up @@ -70,9 +70,6 @@ export default defineComponent({
const grade = this.grades.indexOf(this.grade);
return grade === -1 ? 0 : grade;
},
selectedPWCState(): number {
return this.showPWCSchedule ? 0 : 1;
},
},
methods: {
...mapActions(useScheduleStore, ['setDefaultScheduleMode']),
Expand Down

0 comments on commit 71b2328

Please sign in to comment.