🐛 Fixed Unsplash image selector being empty when first opening (#1100)

closes https://github.com/TryGhost/Ghost/issues/10455
- call `loadNew()` when initialising the `unsplash` service. Services are lazy-initialised so this is only called when the service is first injected which happens when the `<GhUnsplash>` component is first rendered
This commit is contained in:
Sumedh Nimkarde 2019-02-06 16:10:34 +05:30 committed by Kevin Ansfield
parent 5cd442ee96
commit 1cf7e576d9
2 changed files with 2 additions and 0 deletions

View File

@ -29,6 +29,7 @@ export default Service.extend({
init() {
this._super(...arguments);
this._reset();
this.loadNew();
},
loadNew() {

View File

@ -40,6 +40,7 @@ export default function () {
this.passthrough('https://count.ghost.org/');
this.passthrough('http://www.gravatar.com/**');
this.passthrough('https://cdn.jsdelivr.net/**');
this.passthrough('https://api.unsplash.com/**');
}
// Mock all endpoints here as there is no real API during testing