-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
413 additions
and
3,011 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { default as connect_c2s } from './useConnect_c2s'; | ||
export { default as useRegister_c2s } from './useRegister_c2s'; | ||
export { default as useDisconnect_c2s } from './useDisconnect_c2s'; | ||
export { default as useGetAccountInfo_c2s } from './useGetAccountInfo_c2s'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { MutationHook } from '@common/types/hooks'; | ||
import { useRegister_c2s } from '@common/c2s'; | ||
import { UseRegister } from '@common/c2s/useRegister_c2s'; | ||
import store from 'framework/redux/store'; | ||
import { addToContext } from 'framework/redux/slices/streamHandler.slice'; | ||
import { invoke } from '@tauri-apps/api/tauri'; | ||
export default useRegister_c2s as UseRegister<typeof handler>; | ||
|
||
export type UseGetAccountInfoHookDescriptor = { | ||
invokerInput: { | ||
uuid: string; | ||
cid?: string; | ||
}; | ||
dataReturn: any; | ||
}; | ||
|
||
export const handler: MutationHook<UseGetAccountInfoHookDescriptor> = { | ||
//// Invoker input is connect because connect_after_register is true in register command | ||
invokerOptions: { | ||
type: 'getAccInfo', | ||
}, | ||
invoker: async (context) => { | ||
let { invoke, input, options } = context; | ||
|
||
const { data } = await invoke(options.type, input); | ||
|
||
return data; | ||
}, | ||
useHook: | ||
({ invoke }) => | ||
() => { | ||
return async (input) => { | ||
const response = await invoke(input); | ||
store.dispatch( | ||
addToContext({ | ||
req_id: response, | ||
context_type: 'getAccInfo', | ||
}) | ||
); | ||
|
||
return response; | ||
}; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { MutationHook } from '@common/types/hooks'; | ||
import { useHook, useMutationHook } from '@common/utils/useHook'; | ||
|
||
export type UseGetAccountinfo<H extends MutationHook = MutationHook<any>> = | ||
ReturnType<H['useHook']>; | ||
|
||
const useRegister_c2s: UseGetAccountinfo = () => { | ||
const hook = useHook((hooks) => hooks.c2s.useGetAccountInfo); | ||
return useMutationHook({ ...hook })(); | ||
}; | ||
|
||
export default useRegister_c2s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Layout } from '@components/common/Layout'; | ||
|
||
const Server = () => { | ||
return ( | ||
<div className="text-4xl text-teal-50 text-center mb-[50%] select-none"> | ||
<h1>Welcome to the Citadel Server</h1> | ||
<h2>Click on Discussions to enter the chat</h2> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Server; | ||
|
||
Server.Layout = Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Layout } from '@components/common/Layout'; | ||
|
||
const FindPeers = () => { | ||
return ( | ||
<div className="text-4xl text-teal-50 text-center mb-[50%] select-none"> | ||
<h1>Welcome to the Citadel Server</h1> | ||
<h2>Find Peers</h2> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FindPeers; | ||
|
||
FindPeers.Layout = Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Layout } from '@components/common/Layout'; | ||
|
||
const Storage = () => { | ||
return ( | ||
<div className="text-4xl text-teal-50 text-center mb-[50%] select-none"> | ||
<h1>Welcome to the Citadel Server</h1> | ||
<h2>Storage</h2> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Storage; | ||
|
||
Storage.Layout = Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
5 changes: 0 additions & 5 deletions
5
src-tauri/prisma/migrations/20230818091812_sessions/migration.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.