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

Refactor toggling to avoid duplicate upload #2693

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ildyria
Copy link
Member

@ildyria ildyria commented Nov 16, 2024

  • improve code style on ref()
  • use boolean globally defined in a store state for the most important modals (new album, upload)

See in particular:
https://github.com/LycheeOrg/Lychee/pull/2693/files#diff-5585be2db0c41adcd345e27400e1476598e1979d611d3030d032d049f64f12e4
https://github.com/LycheeOrg/Lychee/pull/2693/files#diff-4fdc99a20d4bdd62b978a193d29a30934d64bf6ceb26f010bd441b9e9ac167db
TODO later: migrate the other booleans (rename etc) to that store.

Copy link

codecov bot commented Nov 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.72%. Comparing base (15c8908) to head (2aec888).

Additional details and impacted files

@ildyria ildyria added High Priority High priority issues Review: easy Easy review expected: probably just need a quick to go through. labels Nov 16, 2024
@ildyria ildyria added this to the 6.1.0 milestone Nov 16, 2024
@ildyria ildyria requested a review from d7415 November 16, 2024 02:00
Copy link
Contributor

Choose a reason for hiding this comment

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

the code is duplicate props.config.value === "1", maybe you could save the result above in a const

Copy link
Member Author

Choose a reason for hiding this comment

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

But a const would not be updated on a save of the value as done with the watch :/

Copy link
Contributor

Choose a reason for hiding this comment

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

computed?

const trackLayer = ref(undefined as any);
const data = ref(undefined as undefined | App.Http.Resources.Collections.PositionDataResource);
const bounds = ref<LatLngBoundsLiteral | undefined>(undefined);
const photoLayer = ref<any>(undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

any is bad, is there no model that can be used?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I know, but this is untyped code from a library. On that one not much chance, and I don't feel like typing the damn thing. :')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority High priority issues Review: easy Easy review expected: probably just need a quick to go through.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants