-
Notifications
You must be signed in to change notification settings - Fork 350
Show current organization's name and logo atop main menu #1937
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
base: main
Are you sure you want to change the base?
Changes from all commits
87ddd72
c40a8d9
83f3f9e
c9c67d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -423,14 +423,25 @@ abstract class PerAccountStoreBase { | |
| /// Always equal to `account.realmUrl` and `connection.realmUrl`. | ||
| Uri get realmUrl => connection.realmUrl; | ||
|
|
||
| String? get realmName => account.realmName; | ||
| // The `account` is populated with the `realmName` before | ||
| // PerAccountStore is created, so this should never be null. | ||
| // See `UpdateMachine.load`. | ||
| String get realmName => account.realmName!; | ||
|
|
||
| Uri? get realmIcon => account.realmIcon; | ||
| // The `account` is populated with the `realmIcon` before | ||
| // PerAccountStore is created, so this should never be null. | ||
| // See `UpdateMachine.load`. | ||
| Uri get realmIcon => account.realmIcon!; | ||
|
|
||
| /// Resolve [realmIcon] as a URL relative to [realmUrl]. | ||
| /// | ||
| /// This returns null if resolving fails. | ||
| Uri? resolveRealmIconUrl() => _tryResolveUrl(realmUrl, realmIcon); | ||
|
|
||
| /// Resolve [reference] as a URL relative to [realmUrl]. | ||
| /// | ||
| /// This returns null if [reference] fails to parse as a URL. | ||
| Uri? tryResolveUrl(String reference) => _tryResolveUrl(realmUrl, reference); | ||
| Uri? tryResolveUrl(String reference) => _tryResolveUrlStr(realmUrl, reference); | ||
|
|
||
| /// Always equal to `connection.zulipFeatureLevel` | ||
| /// and `account.zulipFeatureLevel`. | ||
|
|
@@ -459,17 +470,28 @@ abstract class PerAccountStoreBase { | |
| int get selfUserId => core.selfUserId; | ||
| } | ||
|
|
||
| const _tryResolveUrl = tryResolveUrl; | ||
| const _tryResolveUrlStr = tryResolveUrlStr; | ||
|
|
||
| /// Like [Uri.resolve], but on failure return null instead of throwing. | ||
| Uri? tryResolveUrl(Uri baseUrl, String reference) { | ||
| Uri? tryResolveUrlStr(Uri baseUrl, String reference) { | ||
|
Comment on lines
475
to
+476
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move this helper to a different file, like maybe lib/basic.dart? It's a convenience function encapsulating some control flow (a try/catch) and doesn't depend on details of a store. Ditto the new, parallel helper that you're adding, which takes a
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or, alternatively, I think we could just make both of these helpers private. |
||
| try { | ||
| return baseUrl.resolve(reference); | ||
| } on FormatException { | ||
| return null; | ||
| } | ||
| } | ||
|
|
||
| const _tryResolveUrl = tryResolveUrl; | ||
|
|
||
| /// Like [Uri.resolve], but on failure return null instead of throwing. | ||
| Uri? tryResolveUrl(Uri baseUrl, Uri reference) { | ||
| try { | ||
| return baseUrl.resolveUri(reference); | ||
| } on FormatException { | ||
| return null; | ||
| } | ||
| } | ||
|
|
||
| /// Store for the user's data for a given Zulip account. | ||
| /// | ||
| /// This should always have a consistent snapshot of the state on the server, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flutter analyzeis complaining to me at this commit: