Browse Source

:art: fix https://github.com/siyuan-note/siyuan/issues/7610

Vanessa 2 years ago
parent
commit
faf08d6c60
2 changed files with 8 additions and 1 deletions
  1. 7 0
      app/src/card/openCard.ts
  2. 1 1
      app/src/types/index.d.ts

+ 7 - 0
app/src/card/openCard.ts

@@ -6,6 +6,7 @@ import {Constants} from "../constants";
 import {disabledProtyle, onGet} from "../protyle/util/onGet";
 import {hasClosestByClassName} from "../protyle/util/hasClosest";
 import {hideElements} from "../protyle/ui/hideElements";
+import {needSubscribe} from "../util/needSubscribe";
 
 export const openCard = () => {
     const exit = window.siyuan.dialogs.find(item => {
@@ -185,6 +186,12 @@ export const openCardByData = (cardsData: ICard[], html = "") => {
                 cardID: blocks[index].cardID,
                 rating: parseInt(type)
             }, () => {
+                /// #if MOBILE
+                if ((0 !== window.siyuan.config.sync.provider || (0 === window.siyuan.config.sync.provider && !needSubscribe(""))) &&
+                    window.siyuan.config.repo.key && window.siyuan.config.sync.enabled) {
+                    document.getElementById("toolbarSync").classList.remove("fn__none");
+                }
+                /// #endif
                 index++;
                 editor.protyle.element.classList.add("card__block--hide");
                 if (index > blocks.length - 1) {

+ 1 - 1
app/src/types/index.d.ts

@@ -394,7 +394,7 @@ declare interface IConfig {
         stat: string
         interval: number
         cloudName: string
-        provider: number
+        provider: number    // 0 官方同步, 2 S3, 3 WebDAV
         s3: {
             endpoint: string
             pathStyle: boolean