diff --git a/addon/helpers/storage.js b/addon/helpers/storage.js index 67531b20..6ab19cad 100644 --- a/addon/helpers/storage.js +++ b/addon/helpers/storage.js @@ -61,6 +61,11 @@ function tryStorage(name) { } function getStorage(name) { + // Attempt to fall back to localStorage if the provided + // type is not supported, ignoring custom drivers + if (!localforage.supports(drivers[name]) && !customDrivers[name]) { + name = 'local'; + } if (storage[name]) { return storage[name]; } else { diff --git a/addon/serializers/serializer.js b/addon/serializers/serializer.js index c5488dfe..a49405bd 100644 --- a/addon/serializers/serializer.js +++ b/addon/serializers/serializer.js @@ -9,7 +9,7 @@ export default JSONAPISerializer.extend({ _shouldSerializeHasMany: function() { return true; }, shouldSerializeHasMany: function() { return true; }, // Ensure that returned data is null if undefined - normalizeResponse(store, modelClass, payload, id, requestType) { + normalizeResponse() { const result = this._super(...arguments); if (result.data === undefined) { result.data = null;