-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Line Settings with other headers, fix dc reasons.
Disconnect reason dialog will no longer randomly disappear.
- Loading branch information
Showing
5 changed files
with
41 additions
and
21 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
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,19 +1,28 @@ | ||
// Consider using Recoil instead of Context? | ||
import React from 'react' | ||
import { MinecraftChat } from '../minecraft/chatToJsx' | ||
import { ServerConnection } from '../minecraft/connection' | ||
|
||
export interface Connection { | ||
connection: ServerConnection | ||
serverName: string | ||
} | ||
|
||
export interface DisconnectReason { | ||
server: string | ||
reason: MinecraftChat | ||
} | ||
|
||
export interface ConnectionContext { | ||
connection?: Connection | ||
setConnection: (newConnection?: Connection) => void | ||
disconnectReason?: DisconnectReason | ||
setDisconnectReason: (newDisconnectReason?: DisconnectReason) => void | ||
} | ||
|
||
const connectionContext = React.createContext<ConnectionContext>({ | ||
setConnection: () => {} | ||
setConnection: () => {}, | ||
setDisconnectReason: () => {} | ||
}) | ||
|
||
export default connectionContext |
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