Skip to content

Commit

Permalink
chore: Update loading page to display number 8 and improve update che…
Browse files Browse the repository at this point in the history
…cking in electron main.js
  • Loading branch information
truemiller committed May 13, 2024
1 parent bd32794 commit 5bc044d
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
13 changes: 3 additions & 10 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const dotenv = require('dotenv');
const build = require('electron-builder').build;
const publishOptions = require('./electron/constants/publishOptions');

dotenv.config();

Expand All @@ -26,15 +27,7 @@ const main = async () => {
arch: ['arm64'],
},
],
publish: {
provider: 'github',
owner: 'valory-xyz',
repo: 'olas-operate-app',
releaseType: 'release',
token: process.env.GH_TOKEN,
private: true,
publishAutoUpdate: true,
},
publish: publishOptions,
category: 'public.app-category.utilities',
icon: 'electron/assets/icons/splash-robot-head.png',
hardenedRuntime: true,
Expand All @@ -49,4 +42,4 @@ const main = async () => {
});
};

main().then((response) => { console.log('Build & Notarize complete'); console.log(response) }).catch((e) => console.error(e));
main().then((response) => { console.log('Build & Notarize complete'); }).catch((e) => console.error(e));
11 changes: 11 additions & 0 deletions electron/constants/publishOptions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const publishOptions = {
provider: 'github',
owner: 'valory-xyz',
repo: 'olas-operate-app',
releaseType: 'release',
token: process.env.GH_TOKEN,
private: true,
publishAutoUpdate: true,
};

module.exports = { publishOptions };
2 changes: 1 addition & 1 deletion electron/loading/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="black" aria-hidden="true"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg>
</span>
</div>
<p>7</p>
<p>8</p>
<!-- <div id="text" class="text">Loading...</div> -->
</div>
</body>
Expand Down
3 changes: 2 additions & 1 deletion electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ ipcMain.on('check', async function (event, argument) {
try {
event.sender.send('response', 'Checking for updates');
await macUpdater.checkForUpdates().then((res) => {
if (res.downloadPromise) {
if (res) {
console.log(res);
res.downloadPromise.then(() => {
event.sender.send('response', 'Update downloaded');
macUpdater.quitAndInstall();
Expand Down
1 change: 0 additions & 1 deletion electron/notarize.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ exports.default = async function notarizing(context) {

await notarize({
appPath: `${appOutDir}/${appName}.app`,
// appBundleId: 'xyz.valory.olas-operate-app',
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
teamId: process.env.APPLETEAMID,
Expand Down
8 changes: 3 additions & 5 deletions electron/update.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
const { publishOptions } = require('./constants/publishOptions');
const electronUpdater = require('electron-updater');
const macUpdater = new electronUpdater.MacUpdater();

const macUpdater = new electronUpdater.MacUpdater(publishOptions);

macUpdater.autoDownload = true;
macUpdater.autoInstallOnAppQuit = true;
macUpdater.logger = require('electron-log');

macUpdater.on('update-available', () => {
macUpdater.downloadUpdate();
});

macUpdater.on('update-not-available', () => {
console.log('No updates available');
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
"start": "electron .",
"build": "rm -rf dist/ && electron-builder build"
},
"version": "0.1.0-rc15.7"
"version": "0.1.0-rc15.8"
}

0 comments on commit 5bc044d

Please sign in to comment.