Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Guhapriya01 committed Mar 25, 2024
1 parent 5f165de commit a2a5fd1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
3 changes: 0 additions & 3 deletions app/routes/library/details/books.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import Route from '@ember/routing/route';

export default class LibraryDetailsBooksRoute extends Route {
model(){
console.log("e");
}
}
17 changes: 12 additions & 5 deletions app/services/user-preference.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ export default class UserPreferenceService extends Service {
}

get theme(){
let cookieArr = document.cookie.split('=');
// console.log(cookieArr.length)
if(cookieArr.length>1){
return cookieArr[1];
let cookieArr = document.cookie.split(';');
let t = 'light';

if(cookieArr.length>0){
cookieArr.forEach((cookie)=>{
let keyValue = cookie.split("=");
if(keyValue[0]=='theme'){
t = keyValue[1];
}
})

}
return 'light';
return t;
}
}

0 comments on commit a2a5fd1

Please sign in to comment.