forked from coracle/flotilla
Add nip 01 login flow to mobile
This commit is contained in:
@@ -76,3 +76,16 @@ export const createScroller = ({
|
||||
}
|
||||
|
||||
export const isMobile = "ontouchstart" in document.documentElement
|
||||
|
||||
export const downloadText = (filename: string, text: string) => {
|
||||
const blob = new Blob([text], {type: "text/plain"})
|
||||
const url = URL.createObjectURL(blob)
|
||||
const a = document.createElement("a")
|
||||
|
||||
a.href = url
|
||||
a.download = filename
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
URL.revokeObjectURL(url)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user