From eb067270e327de4a4ba4da12bd7ed073becb9cba Mon Sep 17 00:00:00 2001 From: developomp Date: Thu, 27 Jul 2023 11:34:39 +0900 Subject: [PATCH] improve PR diff --- .eslintrc.js | 1 + electron.js | 4 +++- electron/js/window.js | 2 +- package.json | 16 +++++++++++++--- src/ts/component/widget/index.tsx | 3 +-- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index d6c32af400..215c2e8bd2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,6 +22,7 @@ module.exports = { "semi": ["warn", "always"], "quotes": "off", "no-mixed-spaces-and-tabs": "warn", + "no-unsafe-optional-chaining": "warn", "no-useless-escape": "warn", "no-empty": "off", "no-fallthrough": "off", diff --git a/electron.js b/electron.js index ead4e56e3e..ca34d9a14a 100644 --- a/electron.js +++ b/electron.js @@ -60,10 +60,12 @@ let csp = [ if (is.development && !port) { console.error('ERROR: Please define SERVER_PORT env var'); Api.exit(mainWindow, '', false); + return; }; if (app.isPackaged && !app.requestSingleInstanceLock()) { Api.exit(mainWindow, '' ,false); + return; }; remote.initialize(); @@ -201,4 +203,4 @@ app.on('open-url', (e, url) => { Util.send(mainWindow, 'route', Util.getRouteFromUrl(url)); mainWindow.show(); }; -}); \ No newline at end of file +}); diff --git a/electron/js/window.js b/electron/js/window.js index 8b2916fb42..322f9ac140 100644 --- a/electron/js/window.js +++ b/electron/js/window.js @@ -234,4 +234,4 @@ class WindowManager { }; -module.exports = new WindowManager(); \ No newline at end of file +module.exports = new WindowManager(); diff --git a/package.json b/package.json index 9e0ec44b64..a4d9766fd6 100644 --- a/package.json +++ b/package.json @@ -151,7 +151,9 @@ { "name": "Anytype", "role": "Editor", - "schemes": ["anytype"] + "schemes": [ + "anytype" + ] } ], "asarUnpack": [ @@ -489,7 +491,10 @@ "entitlementsInherit": "electron/entitlements.mac.plist", "target": { "target": "default", - "arch": ["x64", "arm64"] + "arch": [ + "x64", + "arm64" + ] }, "identity": "J3NXTX3T5S", "category": "public.app-category.productivity", @@ -528,7 +533,12 @@ "linux": { "icon": "electron/img/icon512x512.png", "category": "Utility", - "target": ["snap", "AppImage", "deb", "rpm"], + "target": [ + "snap", + "AppImage", + "deb", + "rpm" + ], "description": "Anytype", "publish": [ { diff --git a/src/ts/component/widget/index.tsx b/src/ts/component/widget/index.tsx index 389a6883c2..2ae8ae9364 100644 --- a/src/ts/component/widget/index.tsx +++ b/src/ts/component/widget/index.tsx @@ -331,7 +331,6 @@ const WidgetIndex = observer(class WidgetIndex extends React.Component { getData (subId: string, callBack?: () => void) { const { block, isPreview } = this.props; const child = this.getTargetBlock(); - // eslint-disable-next-line no-unsafe-optional-chaining const { targetBlockId } = child?.content; const sorts = []; const filters: I.Filter[] = [ @@ -448,4 +447,4 @@ const WidgetIndex = observer(class WidgetIndex extends React.Component { }); -export default WidgetIndex; \ No newline at end of file +export default WidgetIndex;