Skip to content

Commit

Permalink
refactor: auth magic
Browse files Browse the repository at this point in the history
  • Loading branch information
Xmader committed Nov 9, 2020
1 parent 4de6343 commit 45645fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let magic: Promise<string> | string = new Promise((resolve) => {
const fn = r.a
t.d(r, 'a', () => {
return (...args) => {
if (typeof magic !== 'string') {
if (magic instanceof Promise) {
magic = args[MAGIC_ARG_INDEX]
resolve(magic)
}
Expand All @@ -48,7 +48,7 @@ export const getFileUrl = async (type: FileType, index = 0): Promise<string> =>

const fn: (id: number, index: number, cb: (url: string) => any, magic: string) => string = fileUrlModule.a

if (typeof magic !== 'string') {
if (magic instanceof Promise) {
// force to retrieve the MAGIC
const el = document.querySelectorAll('.SD7H- > button')[3] as HTMLButtonElement
el.click()
Expand Down

0 comments on commit 45645fe

Please sign in to comment.