Merge pull request #5349 from andelf/fix/wrong-file-sync-warning

fix(sync): check current-user-uuid against nil
This commit is contained in:
rcmerci
2022-05-18 16:30:14 +08:00
committed by GitHub
2 changed files with 13 additions and 8 deletions

View File

@@ -164,7 +164,7 @@ test('multiple code block', async ({ page }) => {
await page.waitForSelector('.CodeMirror pre', { state: 'visible' })
await page.waitForTimeout(500)
await page.click('.CodeMirror pre >> nth=1')
await page.click('.CodeMirror >> nth=1 >> pre')
await page.waitForTimeout(500)
await page.type('.CodeMirror textarea >> nth=1', '\n :key-test 日本語\n', { strict: true })
@@ -191,11 +191,10 @@ test('click outside to exit', async ({ page }) => {
expect(await page.inputValue('.block-editor textarea')).toBe('Header ``Click``\n```\n ABC DEF\n GHI\n```')
})
test('click language label to exit #3463', async ({ page }) => {
test('click language label to exit #3463', async ({ page, block }) => {
await createRandomPage(page)
await page.press('.block-editor textarea', 'Enter')
await page.waitForTimeout(200)
await block.enterNext();
await page.fill('.block-editor textarea', '```cpp\n```')
await page.waitForTimeout(200)

View File

@@ -1439,10 +1439,16 @@
(defn- check-graph-belong-to-current-user
[current-user-uuid graph-user-uuid]
(let [result (= current-user-uuid graph-user-uuid)]
(when-not result
(notification/show! (t :file-sync/other-user-graph) :warning false))
result))
(cond
(nil? current-user-uuid)
false
(= current-user-uuid graph-user-uuid)
true
:else
(do (notification/show! (t :file-sync/other-user-graph) :warning false)
false)))
(defn check-remote-graph-exists
[local-graph-uuid]