Skip to content

Instantly share code, notes, and snippets.

@shiki
Created February 22, 2019 14:47
Show Gist options
  • Select an option

  • Save shiki/fc81257bf927f7f82b8aba1f725c18d2 to your computer and use it in GitHub Desktop.

Select an option

Save shiki/fc81257bf927f7f82b8aba1f725c18d2 to your computer and use it in GitHub Desktop.

Revisions

  1. shiki created this gist Feb 22, 2019.
    24 changes: 24 additions & 0 deletions NetworkAware.diff
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    diff --git a/WordPress/Classes/ViewRelated/System/NetworkAware.swift b/WordPress/Classes/ViewRelated/System/NetworkAware.swift
    index 2a15b3b88d..3533976cd8 100644
    --- a/WordPress/Classes/ViewRelated/System/NetworkAware.swift
    +++ b/WordPress/Classes/ViewRelated/System/NetworkAware.swift
    @@ -1,3 +1,4 @@
    +import WordPressFlux

    /// Abstracts elements that need to be aware of the network connection status.
    protocol NetworkAware {
    @@ -31,9 +32,11 @@ extension NetworkAwareUI {
    }

    func presentNoNetworkAlert() {
    - let title = NSLocalizedString("Unable to Sync", comment: "Title of error prompt shown when a sync the user initiated fails.")
    - let message = NSLocalizedString("The Internet connection appears to be offline.", comment: "Message of error prompt shown when a sync the user initiated fails.")
    - WPError.showAlert(withTitle: title, message: message)
    + let notice = Notice(
    + title: "",
    + message: NSLocalizedString("No internet connection. Some posts may be unavailable while offline.", comment: "Message of error prompt shown when a sync the user initiated fails.")
    + )
    + ActionDispatcher.dispatch(NoticeAction.post(notice))
    }

    func noConnectionMessage() -> String {