Add base files from AME
This commit is contained in:
parent
e8f3881513
commit
e3c3bded3a
129 changed files with 19056 additions and 0 deletions
19
resources/js/checkAuth.js
Normal file
19
resources/js/checkAuth.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
try {
|
||||
const preferences = ipcRenderer.sendSync('getStore');
|
||||
|
||||
if (MusicKit.getInstance().isAuthorized) {
|
||||
let url = window.location.href;
|
||||
if (preferences.general.startupPage !== "browse") {
|
||||
if (preferences.general.startupPage.includes('library/')) {
|
||||
url = `${window.location.origin}/${preferences.general.startupPage}`;
|
||||
} else {
|
||||
url = `${window.location.origin}/${MusicKit.getInstance().storefrontId}/${preferences.general.startupPage}`;
|
||||
}
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
ipcRenderer.send('userAuthorized', url);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("[JS] Error while trying to apply CheckAuth.js", e);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue