Added flatpak check (Credit to seby)
Moved platform to cfg.main.PLATFORM Made environment vars accessible from cfg.main.ENV Moved update check to cfg.main.UPDATABLE
This commit is contained in:
parent
023843c375
commit
0eb59d1119
4 changed files with 16 additions and 13 deletions
|
@ -616,10 +616,6 @@ export class BrowserWindow {
|
|||
event.returnValue = wpData;
|
||||
})
|
||||
|
||||
ipcMain.on("cider-platform", (event) => {
|
||||
event.returnValue = process.platform;
|
||||
});
|
||||
|
||||
ipcMain.handle("reinstall-widevine-cdm", () => {
|
||||
// remove WidevineCDM from appdata folder
|
||||
const widevineCdmPath = join(app.getPath("userData"), "./WidevineCdm");
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
import * as ElectronStore from 'electron-store';
|
||||
import * as electron from "electron";
|
||||
import {app} from "electron";
|
||||
|
||||
export class Store {
|
||||
static cfg: ElectronStore;
|
||||
|
||||
private defaults: any = {
|
||||
"main": {
|
||||
"PLATFORM": process.platform,
|
||||
"ENV": process.env,
|
||||
"UPDATABLE": app.isPackaged && (!process.mas || !process.windowsStore || !process.env.FLATPAK_ID)
|
||||
},
|
||||
"general": {
|
||||
"close_button_hide": false,
|
||||
"discord_rpc": 1, // 0 = disabled, 1 = enabled as Cider, 2 = enabled as Apple Music
|
||||
|
|
|
@ -604,7 +604,7 @@ const app = new Vue({
|
|||
document.body.classList.add("no-gpu")
|
||||
}
|
||||
this.mk._services.timing.mode = 0
|
||||
this.platform = ipcRenderer.sendSync('cider-platform');
|
||||
this.platform = this.cfg.main.PLATFORM
|
||||
|
||||
this.mklang = await this.MKJSLang()
|
||||
|
||||
|
|
|
@ -950,13 +950,14 @@
|
|||
ipcRenderer.invoke('update-store-mtt', app.cfg.general.close_behavior);
|
||||
},
|
||||
checkIfUpdateDisabled() {
|
||||
if (ipcRenderer.sendSync('disable-update')) {
|
||||
let updateFields = document.getElementsByClassName('update-check');
|
||||
for (var i=0; i < updateFields.length; i++) {
|
||||
updateFields[i].style = "opacity: 0.5; pointer-events: none;";
|
||||
updateFields[i].title = "Not available on this type of build";
|
||||
}
|
||||
if (app.cfg.main.UPDATABLE) return;
|
||||
|
||||
let updateFields = document.getElementsByClassName('update-check');
|
||||
for (let i=0; i < updateFields.length; i++) {
|
||||
updateFields[i].style = "opacity: 0.5; pointer-events: none;";
|
||||
updateFields[i].title = "Not available on this type of build";
|
||||
}
|
||||
|
||||
},
|
||||
promptForRelaunch(){
|
||||
bootbox.confirm(app.getLz('action.relaunch.confirm'), function (result) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue