diff options
Diffstat (limited to 'ui/src/utils.ts')
-rw-r--r-- | ui/src/utils.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/src/utils.ts b/ui/src/utils.ts index e141c681..d3d9696e 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -1,2 +1,9 @@ +import { UserOperation } from './interfaces'; + export let repoUrl = 'https://github.com/dessalines/rust-reddit-fediverse'; export let wsUri = (window.location.protocol=='https:'&&'wss://'||'ws://')+window.location.host + '/service/ws/'; + +export function msgOp(msg: any): UserOperation { + let opStr: string = msg.op; + return UserOperation[opStr]; +} |