Skip to content

Commit

Permalink
Merge pull request #17521 from ovitrif/feature/editor-mode-switching-…
Browse files Browse the repository at this point in the history
…notice

Editing: Show notice when switching editor mode
  • Loading branch information
Antonis Lilis authored Nov 23, 2021
2 parents d56a867 + 455f601 commit 3ca0321
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
18.8
-----
* [*] Editor: Show a compact notice when switching between HTML or Visual mode. [https://github.com/wordpress-mobile/WordPress-iOS/pull/17521]
* [***] Fixed crash where uploading image when offline crashes iOS app. [#17488]

18.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,14 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega
gutenberg.toggleHTMLMode()
mode.toggle()
editorSession.switch(editor: analyticsEditor)
presentEditingModeSwitchedNotice()
}

private func presentEditingModeSwitchedNotice() {
let message = mode == .html
? NSLocalizedString("Switched to HTML mode", comment: "Message of the notice shown when toggling the HTML editor mode")
: NSLocalizedString("Switched to Visual mode", comment: "Message of the notice shown when toggling the Visual editor mode")
gutenberg.showNotice(message)
}

func requestHTML(for reason: RequestHTMLReason) {
Expand Down

0 comments on commit 3ca0321

Please sign in to comment.