mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-12 02:35:42 +00:00
fix: remove signature expiration (#196)
This commit is contained in:
@@ -13,8 +13,6 @@ import { useSignatureFetching } from './useSignatureFetching';
|
|||||||
import { usePendingAdditions } from './usePendingAdditions';
|
import { usePendingAdditions } from './usePendingAdditions';
|
||||||
import { usePendingDeletions } from './usePendingDeletions';
|
import { usePendingDeletions } from './usePendingDeletions';
|
||||||
import { UseSystemSignaturesDataProps } from './types';
|
import { UseSystemSignaturesDataProps } from './types';
|
||||||
import { TIME_ONE_DAY, TIME_ONE_WEEK } from '../constants';
|
|
||||||
import { SignatureGroup } from '@/hooks/Mapper/types';
|
|
||||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||||
|
|
||||||
export function useSystemSignaturesData({
|
export function useSystemSignaturesData({
|
||||||
@@ -159,21 +157,6 @@ export function useSystemSignaturesData({
|
|||||||
onPendingChange?.(combined, undoPending);
|
onPendingChange?.(combined, undoPending);
|
||||||
}, [localPendingDeletions, pendingUndoAdditions, onPendingChange, undoPending]);
|
}, [localPendingDeletions, pendingUndoAdditions, onPendingChange, undoPending]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!systemId) return;
|
|
||||||
const now = Date.now();
|
|
||||||
const oldOnes = signaturesRef.current.filter(sig => {
|
|
||||||
if (!sig.inserted_at) return false;
|
|
||||||
const inserted = new Date(sig.inserted_at).getTime();
|
|
||||||
const threshold = sig.group === SignatureGroup.Wormhole ? TIME_ONE_DAY : TIME_ONE_WEEK;
|
|
||||||
return now - inserted > threshold;
|
|
||||||
});
|
|
||||||
if (oldOnes.length) {
|
|
||||||
const remain = signaturesRef.current.filter(x => !oldOnes.includes(x));
|
|
||||||
handleUpdateSignatures(remain, false, true);
|
|
||||||
}
|
|
||||||
}, [systemId, handleUpdateSignatures, signaturesRef]);
|
|
||||||
|
|
||||||
useMapEventListener(event => {
|
useMapEventListener(event => {
|
||||||
if (event.name === Commands.signaturesUpdated && String(event.data) === String(systemId)) {
|
if (event.name === Commands.signaturesUpdated && String(event.data) === String(systemId)) {
|
||||||
handleGetSignatures();
|
handleGetSignatures();
|
||||||
|
|||||||
Reference in New Issue
Block a user