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