Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
goldbuick committed Dec 14, 2024
1 parent cf712d0 commit 6a07ad0
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions zss/device/register.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { shortenUrl } from 'shaveurl'
import { createdevice } from 'zss/device'
import { useGadgetClient } from 'zss/gadget/data/state'
import { pick } from 'zss/mapping/array'
Expand Down Expand Up @@ -80,6 +79,19 @@ function writebiosselect(select: string) {
}
}

async function shorturl(url: string) {
const formData = new FormData()
formData.append('url', url)
const request = new Request('https://bytes.zed.cafe', {
method: 'POST',
body: formData,
})
const response = await fetch(request)
console.info(response)
debugger
return 'ffff'
}

// softwareasmain

// simple bootstrap manager
Expand Down Expand Up @@ -110,11 +122,8 @@ const register = createdevice(
break
case 'share':
doasync('register:share', async function () {
const shorturl = await shortenUrl(
window.location.href,
pick('1pt', 'cleanuri', 'isgd', 'shrtcode'),
)
writecopyit('share', shorturl, shorturl)
const url = await shorturl(window.location.href)
writecopyit('share', url, url)
})
break
case 'refresh':
Expand Down

0 comments on commit 6a07ad0

Please sign in to comment.