Skip to content

Commit 2e3a6ad

Browse files
committed
Present a Notice after switching a store, informing users that they will only receive notifications from the active store
Try to prevent Hound
1 parent e0385da commit 2e3a6ad

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

WooCommerce/Classes/Authentication/Epilogue/StorePickerViewController.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,27 @@ extension StorePickerViewController {
353353
WooAnalytics.shared.track(.sitePickerContinueTapped,
354354
withProperties: ["selected_store_id": StoresManager.shared.sessionManager.defaultStoreID ?? String()])
355355

356+
presentStoreSwitchedNotice()
357+
356358
dismiss(animated: true) {
357359
AppDelegate.shared.authenticatorWasDismissed()
358360
MainTabBarController.switchToMyStoreTab(animated: true)
359361
}
360362
}
361363
}
364+
365+
private func presentStoreSwitchedNotice() {
366+
guard let newStoreName = StoresManager.shared.sessionManager.defaultSite?.name else {
367+
return
368+
}
369+
let message = NSLocalizedString("Now you will only receive notifications related to \(newStoreName)",
370+
comment: "Message presented after users switch to a new store. "
371+
+ " Reads like: Now you will only receive notifications related to A Store")
372+
373+
let notice = Notice(title: message, feedbackType: .success)
374+
375+
AppDelegate.shared.noticePresenter.enqueue(notice: notice)
376+
}
362377
}
363378

364379

0 commit comments

Comments
 (0)