-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init * new log components * new log fixes * Update greToClientInterpreter.ts * cast controller fix * log time fix * target line * misc fixes * Update index.tsx
- Loading branch information
Showing
35 changed files
with
1,347 additions
and
272 deletions.
There are no files selected for viewing
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,28 +1,14 @@ | ||
import format from "date-fns/format"; | ||
|
||
import postChannelMessage from "../broadcastChannel/postChannelMessage"; | ||
import { ActionLogLine } from "../components/action-log-v2/types"; | ||
import globalStore from "./store"; | ||
|
||
const actionLog = ( | ||
seat: number, | ||
time = new Date(), | ||
str: string, | ||
_grpId = 0 | ||
): void => { | ||
if (seat == -99) { | ||
globalStore.currentActionLog = "version: 1\r\n"; | ||
} else { | ||
// const parsedStr = str.replace(/(<([^>]+)>)/gi, ""); | ||
|
||
globalStore.currentActionLog += `${seat}\r\n`; | ||
globalStore.currentActionLog += `${format(time, "HH:mm:ss")}\r\n`; | ||
globalStore.currentActionLog += `${str}\r\n`; | ||
const actionLog = (line: ActionLogLine): void => { | ||
globalStore.currentActionLog.lines.push(line); | ||
|
||
postChannelMessage({ | ||
type: "ACTION_LOG", | ||
value: globalStore.currentActionLog, | ||
}); | ||
} | ||
postChannelMessage({ | ||
type: "ACTION_LOG", | ||
value: globalStore.currentActionLog, | ||
}); | ||
}; | ||
|
||
export default actionLog; |
Oops, something went wrong.