Skip to content

Commit

Permalink
🐞 fix: 修复偶发性客户端状态栏异常
Browse files Browse the repository at this point in the history
  • Loading branch information
imsyy committed Apr 26, 2024
1 parent c6a1ca4 commit e7c17cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/components/Nav/MainNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<!-- 用户信息 -->
<userData />
<!-- TitleBar -->
<TitleBar v-if="showTitleBar" />
<TitleBar v-if="checkPlatform.electron()" />
</div>
</nav>
</template>
Expand Down Expand Up @@ -122,9 +122,6 @@ const openGithub = () => {
window.open(packageJson.github);
};
// 是否显示 TitleBar
const showTitleBar = computed(() => checkPlatform.electron());
// 主菜单渲染
const mainMenuShow = ref(false);
const mainMenuOptions = computed(() => [
Expand Down
7 changes: 6 additions & 1 deletion src/utils/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ let lastDownloadBlobUrl = null;
*/
export const checkPlatform = {
electron: () => {
return typeof electron !== "undefined";
// return typeof electron !== "undefined";
if (typeof process !== "undefined" && process.versions) {
return process.versions.electron ? true : false;
}
const userAgent = navigator.userAgent.toLowerCase();
return userAgent.includes("electron");
},
macOS: () => {
if (!checkPlatform.electron()) return false;
Expand Down

0 comments on commit e7c17cf

Please sign in to comment.