Skip to content

Feni brian branch 01#1

Open
feni-brian wants to merge 3 commits into
mrezkys:mainfrom
feni-brian:feni-brian-branch-01
Open

Feni brian branch 01#1
feni-brian wants to merge 3 commits into
mrezkys:mainfrom
feni-brian:feni-brian-branch-01

Conversation

@feni-brian

Copy link
Copy Markdown

Made multiple changes to a few files thus far :

  • Reformatted as well as refactored some lines of code in the files.
  • Updated some views from old deprecated versions to newer versions.
  • Nil coalesced the asyncImagePhase profileImageUrl value instead of explicitly unwrapping it.
  • Handled unknown values using @unknown default in the AsyncImage view case.
  • Enabled the preview provider access to the environment object AuthViewModel declared in it.

- Reformatted the code with reindentation and removal of empty or unnecessary whitespaces; this was for easy reading.
- Removed initialisation of immutable value 'metadata' since it wasn't being used and replaced it with an assignment to '_'. Could remove it as well if you wish.
Reformatted the code with reindentation and removal of empty or unnecessary whitespaces; this was for easy reading.
Safely unwrapped the user's profile image url from the authViewModal because explicitly unwrapping the optional causes previews to crash since there isn't any profile image url present or in app storage.
The AsyncImage switch covers known cases, but 'AsyncImagePhase' may have additional unknown values, possibly added in future versions. To handle unknown values, it's best to use the "@unknown default” case.
Unfortunately, 'ContentUnavailableView' is only available in iOS 17.0 or newer; however, it serve well here I think.
The environment object modifier in the preview provider allows the previews to automatically gain access to that environment object. Without it, it simply crashes.
- Removed the two declared state variables. They were rendered unnecessary.
- Removed the button instances as well. No need for them as well.
- Removed the two older versions of the navigation links and replaced them with the latest versions of navigation links.
- Reformatted the code with indentation and removal of extra whitespaces and paragraphs.
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.

1 participant