Skip to content

Commit

Permalink
fix: get logout page working again (#50)
Browse files Browse the repository at this point in the history
This will work once storacha/w3ui#595 is
released.
  • Loading branch information
travis authored Dec 1, 2023
1 parent 51c51aa commit eb2a3aa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 53 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@ucanto/core": "^9.0.0",
"@ucanto/interface": "^9.0.0",
"@ucanto/transport": "^9.0.0",
"@w3ui/react": "^1.0.1",
"@w3ui/react": "^1.1.0",
"@web3-storage/content-claims": "^3.2.1",
"@web3-storage/data-segment": "^5.0.0",
"ariakit-utils": "0.17.0-next.27",
Expand Down
56 changes: 11 additions & 45 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions src/app/logout/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
'use client'
//import { useW3 } from "@w3ui/react"
import { useW3 } from "@w3ui/react"
import { useRouter } from "next/navigation"
import { useEffect } from "react"

export default function LogoutPage () {
//const [, { unloadAgent }] = useW3()
const [, { logout }] = useW3()

function unloadAgent(){
// TODO need to figure out how this will work with the new library
}
const router = useRouter()
useEffect(function () {
if (unloadAgent) {
if (logout) {
async function logOutAndRedirect () {
await unloadAgent()
await logout()
router.push('/')
}
logOutAndRedirect()
Expand Down

0 comments on commit eb2a3aa

Please sign in to comment.