Code optimizations
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<script lang="ts">
|
||||
export let title: string = ''
|
||||
export let description: string = ''
|
||||
export let image: string = ''
|
||||
export let title: string
|
||||
export let description: string = undefined
|
||||
export let image: string = undefined
|
||||
export let url: string = undefined
|
||||
export let type: string = 'website'
|
||||
export let card: string = 'summary_large_image'
|
||||
export let creator: string = '@flayks'
|
||||
export let creator: string = undefined
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
||||
@@ -9,12 +9,13 @@
|
||||
import Button from '$components/atoms/Button.svelte'
|
||||
import Location from '$components/molecules/Location.svelte'
|
||||
|
||||
export let locations: any
|
||||
export let locations: any[]
|
||||
|
||||
const { continents, settings: { explore_list }} = getContext('global')
|
||||
|
||||
// Continents filtering logic
|
||||
let currentContinent: string = undefined
|
||||
|
||||
$: filteredLocations = locations.filter(({ country: { continent }}: any) => {
|
||||
if (!currentContinent) {
|
||||
// Show all locations by default
|
||||
@@ -30,11 +31,7 @@
|
||||
* Filter locations from continent
|
||||
*/
|
||||
const filterLocation = throttle((continent: string) => {
|
||||
if (continent !== currentContinent) {
|
||||
currentContinent = continent
|
||||
} else {
|
||||
currentContinent = undefined
|
||||
}
|
||||
currentContinent = continent !== currentContinent ? continent : null
|
||||
}, 700)
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user