Skip to content

Commit

Permalink
refactor for updated LoaderService
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Oct 23, 2023
1 parent cbc8c46 commit 9cf4144
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions addon/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class ApplicationController extends Controller {
@action createNewStorefront() {
return this.storefront.createNewStorefront({
onSuccess: () => {
const loader = this.loader.show(`Switching to newly created store...`);
const loader = this.loader.show({ loadingMessage: `Switching to newly created store...` });

this.hostRouter.refresh().then(() => {
this.notifyPropertyChange('activeStore');
Expand All @@ -23,7 +23,7 @@ export default class ApplicationController extends Controller {
}

@action switchActiveStore(store) {
const loader = this.loader.show(`Switching Storefront to ${store.name}...`);
const loader = this.loader.show({ loadingMessage: `Switching Storefront to ${store.name}...` });
this.storefront.setActiveStorefront(store);
this.hostRouter.refresh().then(() => {
this.notifyPropertyChange('activeStore');
Expand Down
2 changes: 1 addition & 1 deletion addon/controllers/products/index/category/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class ProductsIndexCategoryNewController extends Controller {

@action saveProduct() {
const { category } = this.productsIndexCategoryController;
const loader = this.loader.showLoader('body', 'Creating new product...');
const loader = this.loader.showLoader('body', { loadingMessage: 'Creating new product...' });
this.isSaving = true;

if (category) {
Expand Down
2 changes: 1 addition & 1 deletion addon/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class ApplicationRoute extends Route {
@service storefront;

@action loading(transition) {
this.loader.showOnInitialTransition(transition, 'section.next-view-section', 'Loading storefront...');
this.loader.showOnInitialTransition(transition, 'section.next-view-section', { loadingMessage: 'Loading storefront...' });
}

@action willTransition() {
Expand Down
2 changes: 1 addition & 1 deletion addon/routes/products/index/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class ProductsIndexCategoryRoute extends Route {
}

loading(transition) {
this.loader.showOnInitialTransition(transition, 'section.next-view-section', 'Loading products...');
this.loader.showOnInitialTransition(transition, 'section.next-view-section', { loadingMessage: 'Loading products...' });
}

model({ slug, ...params }) {
Expand Down

0 comments on commit 9cf4144

Please sign in to comment.