Browse Source

reduce wait time

feature/kind3-ssl-more
dskvr 2 years ago
parent
commit
3cd28065d3
  1. 6
      src/components/relays/blocks/RelaysResultTable.vue
  2. 22
      src/components/relays/partials/NostrSync.vue
  3. 21
      src/components/relays/tasks/UserRelayList.vue
  4. 2
      src/store/user.js

6
src/components/relays/blocks/RelaysResultTable.vue

@ -170,6 +170,12 @@
</svg>
</td>
<td
colspan="2"
v-if="store.layout.editorExpanded && !store.relays.isFavorite(relay) && store.tasks.getActiveSlug != 'user/relay/list'"
class="w-auto text-center md:table-cell lg:table-cell xl:table-cell">
</td>
<td class="w-16 fav text-center">
<a
class="hover:opacity-100 cursor-pointer"

22
src/components/relays/partials/NostrSync.vue

@ -1,6 +1,13 @@
<template>
<div class="inline" v-if="store.user.getPublicKey.length">
<div class="inline text-left">
<span v-if="savedSuccess" class="inline-block mr-3">
<svg class="h-4 w-4 inline-block" fill="none" stroke="#32CD32" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
Saved to <span>{{ savedSuccess }}</span>
</span>
<button
ref="btnRef"
type="button"
@ -15,9 +22,6 @@
</span>
</button>
<span v-for="url in savedTo" :key="`savedto-${url}`">
saved to {{ url }}
</span>
<button
ref="btnRef"
@ -27,7 +31,7 @@
class="mr-3 inline-flex items-center justify-center rounded-md border border-transparent bg-white/20 px-4 py-2 text-m font-medium text-white shadow-sm hover:bg-white/40 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:w-auto">
Save
</button>
<span ></span>
</div>
</div>
</template>
@ -52,13 +56,21 @@ export default defineComponent({
data() {
return {
changed: false,
savedTo: []
savedTo: [],
savedSuccess: null,
interval: null,
// editor: false,
// popoverShow: false
}
},
mounted(){
this.store.layout.editorOff()
this.interval = setInterval( () => {
if(this.savedTo.length)
this.savedSuccess = this.savedTo.shift()
else
this.savedSuccess = null
}, 1000)
},
unmounted(){
this.store.layout.editorOff()

21
src/components/relays/tasks/UserRelayList.vue

@ -1,8 +1,8 @@
<template>
<span
v-if="this.store.tasks.getActiveSlug === taskSlug && isLoggedIn"
class="text-white lg:text-sm mr-2 ml-2 mt-1.5 text-xs">
<span>Getting user kind 3...</span>
class="text-white lg:text-sm mr-10 ml-2 mt-1.5 text-xs">
<span>Retrieving Relays List...</span>
</span>
</template>
@ -38,23 +38,6 @@ localMethods.invalidate = function(force){
console.log('wtf?', this.taskSlug, !this.isExpired(this.taskSlug) && !force)
// this.queueJob(
// this.taskSlug,
// async () => {
// await this.store.user.setKind3()
// .then( () => {
// Object.keys(this.store.user.kind3).forEach( key => {
// this.store.relays.setFavorite(key)
// })
// this.store.tasks.completeJob()
// })
// .catch( err => {
// console.error('error!', err)
// this.store.tasks.completeJob()
// })
// },
// true
// )
this.queueKind3(this.taskSlug)
}

2
src/store/user.js

@ -72,7 +72,7 @@ export const useUserStore = defineStore('user', {
pool.unsubscribe(subid)
pool.close()
resolve(result)
},10000)
},5000)
})
},
setKind3: async function(obj) {

Loading…
Cancel
Save