mirror of
https://github.com/aljazceru/hypergolic.git
synced 2025-12-18 05:54:21 +01:00
problem: can't get current Bitcoin block height and hash
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
import { ndk } from '@/ndk';
|
||||
import type { NDKUser } from '@nostr-dev-kit/ndk';
|
||||
import { currentUser, prepareUserSession } from '@/stores/session';
|
||||
import { unixTimeNow } from '@/helpers';
|
||||
import { getBitcoinTip } from '@/stores/bitcoin';
|
||||
|
||||
let sessionStarted = false;
|
||||
let connected = false;
|
||||
@@ -24,6 +26,18 @@
|
||||
});
|
||||
sessionStarted = true;
|
||||
}
|
||||
|
||||
let lastRequestTime = 0;
|
||||
|
||||
$: {
|
||||
if (unixTimeNow() > lastRequestTime + 30000) {
|
||||
getBitcoinTip().then((x) => {
|
||||
if (x) {
|
||||
lastRequestTime = unixTimeNow();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<ModeWatcher defaultMode="dark" />
|
||||
|
||||
Reference in New Issue
Block a user