Skip to content

Commit

Permalink
only close windows during factory reset if they are defined
Browse files Browse the repository at this point in the history
  • Loading branch information
matthme committed Jul 6, 2024
1 parent fd02a6a commit 8e77da1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,24 +163,24 @@ jobs:



mark-as-prerelease:
needs: [publish, create-draft-release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Mark release as pre-release
run: |
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/releases/${{ needs.create-draft-release.outputs.release_id }} \
-d '{
"prerelease": true,
"draft": false
}'
# mark-as-prerelease:
# needs: [publish, create-draft-release]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: '18'
# - name: Mark release as pre-release
# run: |
# curl \
# -X PATCH \
# -H "Accept: application/vnd.github.v3+json" \
# -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
# https://api.github.com/repos/${{ github.repository }}/releases/${{ needs.create-draft-release.outputs.release_id }} \
# -d '{
# "prerelease": true,
# "draft": false
# }'


8 changes: 6 additions & 2 deletions src/main/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,15 @@ export async function factoryResetUtility({

// 1. Close all windows to prevent chromium related files to be accessed by them
Object.values(windowInfoMap).forEach((info) => {
info.windowObject.close();
if (info.windowObject) {
info.windowObject.close();
}
});
if (privilegedLauncherWindows) {
Object.values(privilegedLauncherWindows).forEach((window) => {
window.close();
if (window) {
window.close();
}
});
}

Expand Down

0 comments on commit 8e77da1

Please sign in to comment.