Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only show new versions of spaces if they are newer than the local copies #249

Merged
merged 3 commits into from
Jul 28, 2024

Conversation

hiporox
Copy link
Collaborator

@hiporox hiporox commented Jul 11, 2024

No description provided.

Copy link

vercel bot commented Jul 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nounspace-ts ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2024 8:23pm

@@ -59,6 +60,16 @@ export const createHomeBaseStoreFunc = (
const spaceConfig = JSON.parse(
await get().account.decryptEncryptedSignedFile(fileData),
) as SpaceConfig;
const currentHomebase = get().homebase.homebaseConfig;
if (
spaceConfig.timestamp &&
Copy link
Collaborator

@ryannorton ryannorton Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle undefined spaceConfig

if (
spaceConfig.timestamp &&
currentHomebase &&
currentHomebase.timestamp &&
Copy link
Collaborator

@ryannorton ryannorton Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also return true if local config has a timestamp and the fetched one doesn't to fix this issue on existing users' next save

const currentLocalCopy = get().space.localSpaces[spaceId];
if (
spaceConfig &&
spaceConfig.timestamp &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also return true if local config has a timestamp and the fetched one doesn't

@hiporox hiporox requested a review from ryannorton July 12, 2024 20:21
@hiporox
Copy link
Collaborator Author

hiporox commented Jul 12, 2024

@ryannorton Fixed comments

@j-paterson j-paterson merged commit 4909f61 into canary Jul 28, 2024
3 checks passed
@j-paterson j-paterson deleted the hy_timestamp_check_spaces branch July 28, 2024 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants