feat: isolated downloads and slim sidebar logic to store

This commit is contained in:
Roberto Tonino
2020-11-10 21:55:35 +01:00
parent 86e3cda64c
commit 6c32367c80
6 changed files with 133 additions and 67 deletions

View File

@@ -25,3 +25,31 @@ export function getSettingsData() {
})
}
}
/**
* @returns {number}
*/
export function getInitialPreviewVolume() {
let volume = parseInt(localStorage.getItem('previewVolume'))
if (isNaN(volume)) {
volume = 80
localStorage.setItem('previewVolume', volume.toString())
}
return volume
}
/**
* @returns {boolean}
*/
export function checkInitialSlimDownloads() {
return 'true' === localStorage.getItem('slimDownloads')
}
/**
* @returns {boolean}
*/
export function checkInitialSlimSidebar() {
return 'true' === localStorage.getItem('slimSidebar')
}