Add base files from AME

This commit is contained in:
cryptofyre 2021-11-19 17:02:28 -06:00
parent e8f3881513
commit e3c3bded3a
129 changed files with 19056 additions and 0 deletions

19
resources/js/checkAuth.js Normal file
View 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);
}