From fb984b23ce6351269dd69aed716d4da91d946fbc Mon Sep 17 00:00:00 2001 From: Rustem Mussabekov Date: Tue, 21 May 2024 13:46:57 +0300 Subject: [PATCH] Fix electron header issue --- src/co/common/header/index.module.styl | 7 ------- src/co/screen/basic/index.module.css | 13 +++++++++++++ src/data/reducers/bookmarks/sort.js | 4 ++-- src/data/selectors/collections/items.js | 11 +++++++++++ src/routes/account/layout.module.styl | 7 ------- src/routes/join/layout.module.styl | 2 -- 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/co/common/header/index.module.styl b/src/co/common/header/index.module.styl index 89185d68..fd1e6aea 100644 --- a/src/co/common/header/index.module.styl +++ b/src/co/common/header/index.module.styl @@ -1,6 +1,4 @@ .header { - app-region: drag - -webkit-app-region: drag display: flex flex-direction: row align-items: center @@ -14,11 +12,6 @@ position: sticky top: 0 - > * { - app-region: no-drag - -webkit-app-region: no-drag - } - > *:not(:last-child):not(.space) { margin-right: var(--padding-mini) } diff --git a/src/co/screen/basic/index.module.css b/src/co/screen/basic/index.module.css index 76236a8e..07ef70b6 100644 --- a/src/co/screen/basic/index.module.css +++ b/src/co/screen/basic/index.module.css @@ -7,6 +7,19 @@ min-height: 100%; } +/* electron */ +html:before { + content: ''; + position: fixed; + top: 0; + left: 0; + right: 0; + height: env(titlebar-area-height); + app-region: drag; + -webkit-app-region: drag; + z-index: 999999999999999; +} + /* extension */ @media (max-width: 800px) { html:global(.extension:not(.sidepanel):not(.mobile)) .page { diff --git a/src/data/reducers/bookmarks/sort.js b/src/data/reducers/bookmarks/sort.js index c3d56aee..5ab63c20 100755 --- a/src/data/reducers/bookmarks/sort.js +++ b/src/data/reducers/bookmarks/sort.js @@ -17,11 +17,11 @@ export default function(state, action) {switch (action.type) { blankSpace.sorts .setIn( ['sort', 'enabled'], - parseInt(spaceId) != 0 && !space.getIn(['query', 'search']).length ? true : false + parseInt(spaceId) != 0 && !space.getIn(['query', 'search'])?.length ? true : false ) .setIn( ['score', 'enabled'], - space.getIn(['query', 'search']).length ? true : false + space.getIn(['query', 'search'])?.length ? true : false ) ) diff --git a/src/data/selectors/collections/items.js b/src/data/selectors/collections/items.js index 0125a923..929be685 100644 --- a/src/data/selectors/collections/items.js +++ b/src/data/selectors/collections/items.js @@ -139,4 +139,15 @@ export const makeBranchIds = () => createSelector( return getChildrens(_.sortBy(items, ({sort})=>sort), item, 0, true) .map(({item})=>item._id) } +) + +export const makeNested = () => createSelector( + [_collectionsItems, (_, cid)=>cid], + (items, cid)=>{ + if (cid <= 0) + return emptyArray + + return _.sortBy(items, ({sort})=>sort) + .filter(({parentId})=>parentId==cid) + } ) \ No newline at end of file diff --git a/src/routes/account/layout.module.styl b/src/routes/account/layout.module.styl index 41c35027..655e425b 100644 --- a/src/routes/account/layout.module.styl +++ b/src/routes/account/layout.module.styl @@ -1,6 +1,4 @@ .page { - app-region: drag - -webkit-app-region: drag width: 100% overflow: auto display: grid @@ -8,11 +6,6 @@ grid-template-rows: 1fr auto align-items: center justify-content: center - - > * { - app-region: no-drag - -webkit-app-region: no-drag - } } .content { diff --git a/src/routes/join/layout.module.styl b/src/routes/join/layout.module.styl index 83990a77..6ecddde7 100644 --- a/src/routes/join/layout.module.styl +++ b/src/routes/join/layout.module.styl @@ -1,6 +1,4 @@ .page { - app-region: drag - -webkit-app-region: drag width: 100% overflow: auto display: flex