Skip to content

Commit a54a6cc

Browse files
committed
v0.1.1-rc.3
- Fixed mergeOptionsWithParams if options aren't properly defined
1 parent 02790dd commit a54a6cc

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

dist/vue-notification.esm.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,17 +1384,18 @@ function getVerticalOffset(instances, position) {
13841384
}
13851385

13861386
function mergeOptionsWithParams(options, params) {
1387-
if (!options.breakpoints) { return params; }
1387+
var paramsToMerge = typeof params === 'string' ? {
1388+
message: params
1389+
} : params;
1390+
if (!options.breakpoints) { return paramsToMerge; }
13881391
var windowWidth = window.innerWidth;
13891392
var match = -1;
13901393
Object.keys(options.breakpoints).forEach(function (breakpoint) {
13911394
if (breakpoint <= windowWidth && breakpoint > match) {
13921395
match = Number(breakpoint);
13931396
}
13941397
});
1395-
var paramsToMerge = typeof params === 'string' ? {
1396-
message: params
1397-
} : params;
1398+
if (match === -1) { return paramsToMerge; }
13981399
return Object.assign({}, options.breakpoints[match], paramsToMerge);
13991400
}
14001401

@@ -1407,7 +1408,7 @@ var install = function install(Vue) {
14071408

14081409
var plugin = {
14091410
// eslint-disable-next-line no-undef
1410-
version: "0.1.1-rc.2",
1411+
version: "0.1.1-rc.3",
14111412
install: install,
14121413
Notification: Notification
14131414
};

dist/vue-notification.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-notification.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mathieustan/vue-notification",
33
"description": "Clean Notifications made with VueJs",
4-
"version": "0.1.1-rc.2",
4+
"version": "0.1.1-rc.3",
55
"author": "Mathieu Stanowski <mathieu.stan@gmail.com>",
66
"keywords": [
77
"vue",

src/components/Notification/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ function getVerticalOffset (instances, position, { offset = 0 } = {}) {
113113
}
114114

115115
function mergeOptionsWithParams (options, params) {
116-
if (!options.breakpoints) return params;
116+
const paramsToMerge = typeof params === 'string' ? { message: params } : params;
117+
if (!options.breakpoints) return paramsToMerge;
117118

118119
const windowWidth = window.innerWidth;
119120
let match = -1;
@@ -123,7 +124,8 @@ function mergeOptionsWithParams (options, params) {
123124
}
124125
});
125126

126-
const paramsToMerge = (typeof params === 'string') ? { message: params } : params;
127+
if (match === -1) return paramsToMerge;
128+
127129
return Object.assign({}, options.breakpoints[match], paramsToMerge);
128130
}
129131

0 commit comments

Comments
 (0)