Skip to content

Commit

Permalink
Merge pull request #73 from mrodz/master
Browse files Browse the repository at this point in the history
v0.1.5
  • Loading branch information
mrodz authored May 25, 2024
2 parents 1df5b86 + dce7e01 commit 5b5286f
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 21 deletions.
102 changes: 97 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cli"
version = "0.1.4"
version = "0.1.5"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion db/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "db"
version = "0.1.4"
version = "0.1.5"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion db/entity/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "entity"
version = "0.1.4"
version = "0.1.5"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion db/migration/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "migration"
version = "0.1.4"
version = "0.1.5"
edition = "2021"
publish = false

Expand Down
4 changes: 2 additions & 2 deletions desktop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "app"
version = "0.1.4"
version = "0.1.5"
description = "An advanced field scheduling and logistics app"
authors = ["Mateo Rodriguez"]
license = ""
Expand All @@ -17,7 +17,7 @@ tauri-build = { version = "1.5.1", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.5.4", features = ["updater", "dialog-all"] }
tauri = { version = "1.5.4", features = [ "os-all", "updater", "dialog-all"] }
grpc_server = { path = "../gcloud/grpc_server" }
backend = { path = "../backend" }
db = { path = "../db" }
Expand Down
3 changes: 3 additions & 0 deletions desktop/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"all": false,
"dialog": {
"all": true
},
"os": {
"all": true
}
},
"bundle": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fieldz-desktop",
"version": "0.1.4",
"version": "0.1.5",
"scripts": {
"preinstall": "cd webview && npm install"
},
Expand Down
34 changes: 25 additions & 9 deletions webview/src/routes/login/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
signInWithPopup,
getAuth,
GithubAuthProvider,
OAuthProvider
OAuthProvider,
signInWithRedirect
} from 'firebase/auth';
import { goto } from '$app/navigation';
import { slide } from 'svelte/transition';
Expand All @@ -14,12 +15,27 @@
import TwitterIcon from './TwitterIcon.svelte';
import GitHubIcon from './GitHubIcon.svelte';
import MicrosoftIcon from './MicrosoftIcon.svelte';
import { type } from '@tauri-apps/api/os';
const queryParams = new URLSearchParams(window.location.search);
const next = queryParams.get('next') ?? '/';
const toastStore = getToastStore();
const signInFunction = type().then((type) => {
switch (type) {
/*
* The webview on OSX does not support browser popups.
* Why, you might ask?
* No one knows :(
*/
case 'Darwin':
return signInWithRedirect;
default:
return signInWithPopup;
}
});
function duplicatedMessage(error: any) {
if ('code' in error && error.code === 'auth/account-exists-with-different-credential') {
toastStore.trigger({
Expand All @@ -40,7 +56,7 @@
prompt: 'select_account'
});
const userCredential = await signInWithPopup(getAuth(), provider);
const userCredential = await (await signInFunction)(getAuth(), provider);
console.log(userCredential);
Expand All @@ -58,7 +74,7 @@
prompt: 'select_account'
});
const userCredential = await signInWithPopup(getAuth(), provider);
const userCredential = await (await signInFunction)(getAuth(), provider);
console.log(userCredential);
Expand All @@ -73,7 +89,7 @@
try {
const provider = new GithubAuthProvider();
const userCredential = await signInWithPopup(getAuth(), provider);
const userCredential = await (await signInFunction)(getAuth(), provider);
console.log(userCredential);
Expand All @@ -91,7 +107,7 @@
prompt: 'select_account'
});
const userCredential = await signInWithPopup(getAuth(), provider);
const userCredential = await (await signInFunction)(getAuth(), provider);
console.log(userCredential);
Expand All @@ -110,19 +126,19 @@
>

<div class="logo-cloud grid-cols-1 gap-0.5 md:grid-cols-2 2xl:grid-cols-4">
<button class="logo-item" on:click={google}>
<button class="logo-item card-hover" on:click={google}>
<GoogleIcon class="mr-4 w-12" />
Sign In
</button>
<button class="logo-item" on:click={twitter}>
<button class="logo-item card-hover" on:click={twitter}>
<TwitterIcon class="mr-4 w-12" />
Sign In
</button>
<button class="logo-item" on:click={github}>
<button class="logo-item card-hover" on:click={github}>
<GitHubIcon class="mr-4 w-12" />
Sign In
</button>
<button class="logo-item" on:click={microsoft}>
<button class="logo-item card-hover" on:click={microsoft}>
<MicrosoftIcon class="mr-4 w-12" />
Sign In
</button>
Expand Down

0 comments on commit 5b5286f

Please sign in to comment.