Commit Graph

47 Commits

Author SHA1 Message Date
Angelo Stavrow
0d43cb0bd8
Prep for iOS 16 (#223)
* Don’t render spacer in iOS 16+

* Bump version and build for TestFlight

* Bump version and build of action extension

* Run SwiftLint on all files for each build

This prevents a build warning in Xcode 14 because SwiftLint doesn’t yet support input/output files for these script execution build phases. It’s fast enough, so running it on all files isn’t an issue.

* Add missing error handling on login view

* Clean up line_length warning

* Update change log
2022-09-07 08:29:13 -04:00
Angelo Stavrow
a51bbd3abc
Alert on error: shared code (#207)
* Initial work on presenting alert on error

* Move Account-related error handling up the hierarchy

* Handle errors on logout

* Fix for temporary debugging

* Clean up WriteFreelyModel’s published vars

* Add error handling to top-level content view

* Set current error on API call failures

* Set current error on API call handlers

* Move User Defaults errors to ErrorConstants file

* Add default values for some error strings

* Handle purging post errors

* Add FIXME to track silent failure on fetching collections

As collections are fetched and added to the `list` property in the CollectionListModel’s initializer, it’s tricky to throw an error here: we call it as a property initializer in CollectionListView, which cannot throw.

Consider refactoring this logic such that we’re using, for example, a @FetchRequest in CollectionListView instead.

* Handle errors in (most) shared code

Two outliers to come back to are:

- the LocalStoreManager, where we can’t set a current error in the WriteFreelyModel in methods that can’t throw
- the CollectionListModel, where the initializer can’t throw because we use it as a property initializer in CollectionListView

* Add error handling to Mac app

* Revert "Add error handling to Mac app"

This reverts commit b1a8b8b29c.
2022-07-27 09:56:32 -04:00
Angelo Stavrow
3752b85414
Add action extension 2021-11-19 15:41:54 -05:00
Angelo Stavrow
7db11172c0
Move user defaults to App Group 2021-11-05 14:18:36 -04:00
Angelo Stavrow
2f1b895df5
Rename 'persistentContainer' to 'container' 2021-10-08 17:15:38 -04:00
Angelo Stavrow
11ad3bc2ff
Use LocalStorageManager 'standard' singleton 2021-10-08 17:07:06 -04:00
Angelo Stavrow
cfe1613621
Handle thrown Keychain errors with informational alerts 2021-08-20 17:13:41 -04:00
Angelo Stavrow
a354b807fe
Don't try to log in if the server string isn't valid 2021-02-02 11:40:01 -05:00
Angelo Stavrow
de50f3c9a4
Change wording of error message 2021-02-02 11:39:29 -05:00
Angelo Stavrow
6da33e22cc
Add logic for AccountError.invalidServerURL case when logging in 2021-02-02 11:12:30 -05:00
Angelo Stavrow
1a8951a3e0
Use URLComponents to parse out scheme and host if possible 2021-02-01 17:03:40 -05:00
Angelo Stavrow
c00b71cd43
Rewrite server URL string if logging into Write.as 2021-02-01 15:45:33 -05:00
Angelo Stavrow
fa8c0026e7
Drop trailing slash when validating login form 2021-02-01 14:20:42 -05:00
Angelo Stavrow
c87309d6b0
Merge pull request #145 from writeas/fix-ui-for-log-out-alert
Show alert instead of sheet on logout
2020-12-03 12:14:15 -05:00
Angelo Stavrow
ccb342fbc5
Show alert instead of sheet on logout 2020-11-30 10:36:59 -05:00
Angelo Stavrow
7cb7fa3017
Use AppStorage dynamic property instead of direct UserDefaults update
Known issue: the menubar File > Reload From Server command will not update based on changes to model.account.isLoggedIn, but instead defaults to whatever the value was on app launch. Filed as FB8918303 with Apple.
2020-11-26 12:05:20 -05:00
Angelo Stavrow
3c81b5cd68
Propagate login/logout fixes to Mac app target 2020-10-29 17:19:06 -04:00
Angelo Stavrow
e7408a47e9
Fix crash-on-load bug by cleaning up/thread-sanitizing CoreData calls 2020-10-29 16:09:35 -04:00
Angelo Stavrow
5a2b999bcd
Present action sheet to confirm logout 2020-10-22 17:08:16 -04:00
Angelo Stavrow
735326891e
Hide the keyboard on tapping the log-in button 2020-10-22 16:09:18 -04:00
Angelo Stavrow
e736ebbb8c
Add descriptive text to login view 2020-09-29 14:40:15 -04:00
Angelo Stavrow
be69225253
Simplify login error-handling process 2020-09-25 11:00:51 -04:00
Angelo Stavrow
0bde76c7d8
Check for http OR https on login when logging in 2020-09-25 10:55:42 -04:00
Angelo Stavrow
f686b6fb76
Add secure protocol to server string if it's missing 2020-09-24 16:49:09 -04:00
Angelo Stavrow
68607478a3
Clean up some rebase mixups 2020-08-27 12:17:42 -04:00
Angelo Stavrow
20d8ecc80f
Persist logged-in settings for account and server in UserDefaults 2020-08-24 16:53:01 -04:00
Angelo Stavrow
2652eceb12
Persist logged-in state in UserDefaults between app launches 2020-08-24 15:21:46 -04:00
Angelo Stavrow
2a9bd66fa2
Present login-error alert on AccountModel.hasError 2020-08-19 16:35:20 -04:00
Angelo Stavrow
229dbbb37d
Use AccountError localizedDescriptions in login-error alert messages 2020-08-19 16:34:36 -04:00
Angelo Stavrow
1bdd918931
Add localizedError description to AccountError cases 2020-08-19 16:33:16 -04:00
Angelo Stavrow
0a14421122
Disable login button if AccountLoginView fields are empty 2020-08-19 10:10:36 -04:00
Angelo Stavrow
0c20fea0e6
Refactor login/logout to implement WriteFreely package 2020-08-18 17:21:00 -04:00
Angelo Stavrow
49ea70e0a6
Clean up unnecessary AccountLoginView previews 2020-08-17 16:45:02 -04:00
Angelo Stavrow
3384a972b0
Change Result/Failure logic to match new AccountError cases 2020-08-17 13:31:20 -04:00
Angelo Stavrow
a56da3c07b
Fit test data to real-world username format 2020-08-17 13:30:29 -04:00
Angelo Stavrow
0c208fb063
Show alert if the username is not found 2020-08-17 13:30:03 -04:00
Angelo Stavrow
582cab7efb
Fix indentation for server alert message 2020-08-17 13:29:28 -04:00
Angelo Stavrow
216641029d
Catch both invalidPassword and usernameNotFound AccountErrors 2020-08-17 13:20:21 -04:00
Angelo Stavrow
8f6e5b9a0a
Add more specific AccountError cases per API 2020-08-17 13:16:58 -04:00
Angelo Stavrow
c5b18a2440
Use standard keyboard for username entry 2020-08-17 13:10:56 -04:00
Angelo Stavrow
6dba087295
Refactor account views and AccountModel 2020-08-11 16:27:14 -04:00
Angelo Stavrow
35f4762b35
Improve appearance of settings views between platforms 2020-08-10 14:30:23 -04:00
Angelo Stavrow
a7b918c14b
Refactor login view out of AccountView 2020-08-10 13:31:46 -04:00
Angelo Stavrow
4de5293345
Refactor logout view out of AccountView 2020-08-10 13:20:53 -04:00
Angelo Stavrow
4b914891b7
Adapt AccountView to embed in iOS SettingsView form 2020-08-10 12:38:06 -04:00
Angelo Stavrow
93a10e27dd
Rename Account and Settings views and move to Shared code 2020-08-10 10:39:44 -04:00
Angelo Stavrow
ea6e9491c2
Add simple account model for testing login screen 2020-08-07 16:27:23 -04:00