Conversation
attrib
left a comment
There was a problem hiding this comment.
Really cool change. Thanks for this! Like the cool interface.
Just a small suggestion added inline, what do you think about it? If you think the idea is stupid, we can use it like this.
| * @param {WebSocket} client | ||
| */ | ||
| function sendFeatures(client) { | ||
| checkExpiredFeatures() |
There was a problem hiding this comment.
I would move this to conquerUpdater
.then((data) => {
checkExpiredFeatures()
if (data) {
const payload = Object.assign(data, { oldVersion, warNumber: warapi.warData.warNumber })this already runs regullary. then we do not have to add it to all send functions
| }, 60_000) | ||
| for (const featureToCheck of features.features) { | ||
|
|
||
| const expireTime = featureToCheck.properties?.expireTime; |
There was a problem hiding this comment.
crazy idea:
instead of saving the expire time, we save the selected time.
and here we do const expireTime = featureToCheck.properties?.expire + new Date(expireTime).getTime()
then in select.js:
clockColor = (clock, feature) => {
if (NO_CLOCK.includes(feature.get('type'))) {we replace the NO_CLOCK with featureToCheck.properties?.expireTime - so only show the clock if a expire is set.
and the clockColor then depends on time left till expired.
then we would have an option to reset the timer.
what do you think about this idea?
There was a problem hiding this comment.
if we do it like this, we need to update the /help page (decay section)
When a new feature is added the user can choose between a few presets of time until expiration or can enter a custom time.
I did not see a good way to implement users updating the time until expiration after the feature is already created without making the UI either misleading or cluttered, so for now when editing a feature the expiring section is disabled.