Skip to content

Commit

Permalink
Merge pull request #11 from GeoChatter/testing_map
Browse files Browse the repository at this point in the history
Testing map
  • Loading branch information
s0er3n authored Sep 6, 2022
2 parents 33d9e8a + 9d43b10 commit a32bf3d
Show file tree
Hide file tree
Showing 13 changed files with 1,515 additions and 619 deletions.
2,085 changes: 1,489 additions & 596 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions src/lib/Drawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,17 @@
<MapPicker isDrawer={true} />

{#if $user}
<li class="form-control">
<label class="label cursor-pointer">
<span class="label-text">enable copy and paste</span>
<input
type="checkbox"
class="toggle"
on:click={() => $settings.change('copyAndPaste', !$settings.values.copyAndPaste)}
checked={$settings.values.copyAndPaste}
/>
</label>
</li>
<!-- <li class="form-control"> -->
<!-- <label class="label cursor-pointer"> -->
<!-- <span class="label-text">enable copy and paste</span> -->
<!-- <input -->
<!-- type="checkbox" -->
<!-- class="toggle" -->
<!-- on:click={() => $settings.change('copyAndPaste', !$settings.values.copyAndPaste)} -->
<!-- checked={$settings.values.copyAndPaste} -->
<!-- /> -->
<!-- </label> -->
<!-- </li> -->
<li class="form-control">
<label class="label cursor-pointer">
<span class="label-text">enable temporary guess</span>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Leaflet.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { user } from '$lib/supabase';
import { browser } from '$app/env';
import { browser } from '$app/environment';
import { getCountry } from '$lib/js/helpers/getFeature';
// import L from 'leaflet';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Map.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script>
import { user, auth, supabase } from '$lib/supabase';
// @ts-ignore
import { browser } from '$app/env';
import { browser } from '$app/environment';
import { mapType, styles } from '$lib/MapPicker.svelte';
import { LogInIcon, EyeOffIcon, ListIcon, FlagIcon, AwardIcon } from 'svelte-feather-icons';
import Leaflet from './Leaflet.svelte';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/MapBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { user } from '$lib/supabase';
import settings from '$lib/js/settings';
// @ts-ignore
import { browser, dev } from '$app/env';
import { browser, dev } from '$app/environment';
import { mapType } from '$lib/MapPicker.svelte';
import { getCountry } from '$lib/js/helpers/getFeature';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/MapPicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</script>

<script lang="ts">
import { browser } from '$app/env';
import { browser } from '$app/environment';
import { MapIcon } from 'svelte-feather-icons';
const createMostUsedArray = (): string[] => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Twitch.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { browser } from '$app/env';
import { browser } from '$app/environment';
import settings from './js/settings';
</script>

Expand Down
1 change: 1 addition & 0 deletions src/lib/js/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class Api {
constructor(bot: string) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
console.log(import.meta.VITE_GEOCHATTERURL)
this.client = new GCSocketClient(import.meta.env.VITE_GEOCHATTERURL as string, bot ?? "", {
onFailedGuess: (_, text) => {

Expand Down
8 changes: 5 additions & 3 deletions src/lib/js/settings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { writable, type Writable } from "svelte/store"
// @ts-ignore
import { browser } from "$app/env"
import { browser } from "$app/environment"

import { z, MapOptions } from "GCSocketClient"

Expand Down Expand Up @@ -99,9 +99,11 @@ export class Settings {

load() {
if (browser) {
const loadedObj = JSON.parse(localStorage.getItem("settings")) ?? {}
const loadedObj = JSON.parse(localStorage.getItem("settings")) ?? {}
for (const key of Object.keys(loadedObj)) {
this._values[key] = loadedObj[key]
if (key !== "copyAndPaste") {
this._values[key] = loadedObj[key]
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const prerender = true
1 change: 0 additions & 1 deletion src/routes/__layout.svelte → src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script>
import Drawer from '$lib/Drawer.svelte';
import '../app.css';
</script>

Expand Down
4 changes: 3 additions & 1 deletion src/routes/index.svelte → src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script>
import Map from '$lib/Map.svelte';
import { browser, dev } from '$app/env';
import { browser, dev } from '$app/environment';
import { supabase } from '$lib/supabase';
import Auth from '$lib/Auth.svelte';
import { user } from '$lib/supabase';
Expand Down
2 changes: 0 additions & 2 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ const config = {
preprocess: preprocess(),
kit: {

prerender: { enabled: true, default: true },
paths: {
base: dev ? '' : process.env.BASE_PATH

},
adapter: adapter({
// default options are shown
Expand Down

0 comments on commit a32bf3d

Please sign in to comment.