Skip to content

Commit

Permalink
Fixed some bugs
Browse files Browse the repository at this point in the history
(maxWidth bug, router bug)
  • Loading branch information
mxcop committed Feb 12, 2022
1 parent ad656af commit fad001f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
5 changes: 3 additions & 2 deletions public/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ main.unfocused {
}

main {
width: calc(100% - 3px);
height: calc(100% - 3px);
width: calc(100vw - 3px);
height: calc(100vh - 3px);
max-width: none !important;
position: absolute;
top: 0;
left: 0;
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ fn main() {
async fn web_connect(window: Window, username: String) {
println!("Connecting to signal server...");

let addr = env::var("SERVER_ADDRESS").expect("Can load server address from .env");
//let addr = env::var("SERVER_ADDRESS").expect("Can load server address from .env");
let addr = "ws://84.30.14.3:25656";
let (ws_stream, _) = connect_async(addr).await.expect("Failed to connect");
println!("WebSocket handshake has been successfully completed");

Expand Down
2 changes: 2 additions & 0 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
"title": "Flux",
"width": 800,
"height": 600,
"minWidth": 350,
"minHeight": 280,
"resizable": true,
"fullscreen": false,
"decorations": false
Expand Down
14 changes: 8 additions & 6 deletions src/comp/Chat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ store.user.subscribe(value => {
})
const sendMessage = () => {
invoke('send_message', { data: input });
store.globalChat.update(global => {
global.push({ sender: user, content: input });
return global;
});
input = "";
if (input.length > 0) {
invoke('send_message', { data: input });
store.globalChat.update(global => {
global.push({ sender: user, content: input });
return global;
});
input = "";
}
};
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/nav/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const navigate = useNavigate();
// Handle refreshes:
onMount(() => {
if (sessionStorage.getItem("username") == undefined) navigate('/');
if (sessionStorage.getItem("username") == 'null') navigate('/');
});
</script>
Expand Down
4 changes: 2 additions & 2 deletions src/nav/Login.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ listen('onlogin', () => {
});
onMount(() => {
if (sessionStorage.getItem("username") != undefined) navigate('/home');
if (sessionStorage.getItem("username") != 'null') navigate('/home');
});
const join = () => {
if (sessionStorage.getItem("username") == undefined) {
if (sessionStorage.getItem("username") == 'null') {
invoke('web_connect', { username: name });
} else {
navigate('/home');
Expand Down

0 comments on commit fad001f

Please sign in to comment.