feat: added ability to reset the releaseFeature logic by updating the featureReleaseTimestamp

pull/2660/head
William Grant 2 years ago
parent 80f18e9f1c
commit 15c054a35e

@ -1,7 +1,8 @@
import { Data } from '../data/data';
// TODO update to agreed value between platforms
const featureReleaseTimestamp = 1677488400; // unix 27/02/2023 09:00
// const featureReleaseTimestamp = 1677488400000; // unix 27/02/2023 09:00
const featureReleaseTimestamp = 1677661200000; // unix 01/03/2023 09:00
let isFeatureReleased: boolean | undefined;
/**
@ -45,6 +46,15 @@ export async function checkIsFeatureReleased(featureName: string): Promise<boole
});
}
return true;
} else {
// Reset featureReleased to false if we have already released a feature since we have updated the featureReleaseTimestamp to a later date.
// The alternative solution would be to do a db migration everytime we want to use this system.
if (featureAlreadyReleased) {
await Data.createOrUpdateItem({
id: 'featureReleased',
value: false,
});
}
}
}

Loading…
Cancel
Save