Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
🐛 Smh env
Browse files Browse the repository at this point in the history
  • Loading branch information
i1u5 committed Mar 17, 2020
1 parent 54a56eb commit d5bc14e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 21 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@ jobs:
yarn run dist
- name: Building
run: yarn run build
env:
DSN: ${{ secrets.DSN }}
- name: Building AppImage
run: |
jq -c '.productName = "PreMiD Portable"' ./dist/app/package.json > tmp.$$.json && mv tmp.$$.json ./dist/app/package.json
yarn run build:n-appimage
env:
DSN: ${{ secrets.DSN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down Expand Up @@ -78,8 +74,6 @@ jobs:
yarn run dist
- name: Building
run: yarn run build
env:
DSN: ${{ secrets.DSN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
Expand All @@ -97,4 +91,3 @@ jobs:
yarn run build:appimage
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DSN: ${{ secrets.DSN }}
2 changes: 1 addition & 1 deletion @types/PreMiD/ExtensionSettings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default interface ExtensionSettings {
/**
* If the user approved to use the automatic crash reporter
*/
improvementProgramme: boolean;
improvementProgram: boolean;
/**
* If extension is enabled
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"license": "MPL-2.0",
"scripts": {
"init": "tsc && devScript --copyOnly",
"start": "npm run init && electron dist/app/.",
"start": "electron dist/app/.",
"dev": "devScript",
"dist": "tsc && devScript --copyOnly && cd dist/app/ && npm i",
"build": "electron-builder --project ./dist/app/",
Expand Down
9 changes: 4 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { checkForUpdate } from "./util/updateChecker";

export let trayManager: TrayManager;

//* Define and set it to null
//* Set AppUserModelId for task manager etc
//* When app is ready
export let updateCheckerInterval = null;
app.whenReady().then(async () => {
Expand Down Expand Up @@ -54,11 +52,12 @@ app.whenReady().then(async () => {
});

async function initReporter(firstLaunch: boolean = false) {
if (firstLaunch) settings.set("improvementProgramme", true);
if (settings.get("improvementProgramme")) {
if (firstLaunch) settings.set("improvementProgram", true);
if (settings.get("improvementProgram")) {
console.log("Initializing Sentry...");
Sentry.init({
dsn: process.env.DSN
// definitely not exposed
dsn: "https://[email protected]/5022280"
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/managers/settingsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export let settings = new ElectronStore({
defaults: {
firstLaunch: true,
autoLaunch: true,
improvementProgramme: false
improvementProgram: false
}
});

Expand Down
15 changes: 9 additions & 6 deletions src/util/updateChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ autoUpdater.autoDownload = false;

export async function checkForUpdate(auto = false) {
autoUpdater.autoDownload = auto;
updateTray("checking");
try {
autoUpdater.checkForUpdates();
} catch (error) {
Expand Down Expand Up @@ -57,10 +56,14 @@ function updateTray(reason: string) {

// Temporarily
function errHandler(error: any) {
console.log(
"An error occured while updating " +
(autoUpdater.autoDownload ? "[AUTO] :" : "[MANUAL] :"),
error ? (error.stack || error).toString() : "unknown"
);
if (error.includes("ERR_INTERNET_DISCONNECTED")) {
console.log("No internet detected, skipping update check.");
} else {
console.log(
"An error occured while updating " +
(autoUpdater.autoDownload ? "[AUTO] :" : "[MANUAL] :"),
error ? (error.stack || error).toString() : "unknown"
);
}
updateTray("standby");
}

0 comments on commit d5bc14e

Please sign in to comment.