antd-mobile 2.3.0 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,14 +34,11 @@ var _config = {
34
34
  mask: true
35
35
  };
36
36
  var messageInstance = void 0;
37
+ var messageNeedHide = void 0;
37
38
  var prefixCls = 'am-toast';
38
39
  function getMessageInstance(mask, callback) {
39
40
  var _classnames;
40
41
 
41
- if (messageInstance) {
42
- messageInstance.destroy();
43
- messageInstance = null;
44
- }
45
42
  _rmcNotification2['default'].newInstance({
46
43
  prefixCls: prefixCls,
47
44
  style: {},
@@ -64,7 +61,20 @@ function notice(content, type) {
64
61
  loading: 'loading'
65
62
  };
66
63
  var iconType = iconTypes[type];
64
+ messageNeedHide = false;
67
65
  getMessageInstance(mask, function (notification) {
66
+ if (!notification) {
67
+ return;
68
+ }
69
+ if (messageInstance) {
70
+ messageInstance.destroy();
71
+ messageInstance = null;
72
+ }
73
+ if (messageNeedHide) {
74
+ notification.destroy();
75
+ messageNeedHide = false;
76
+ return;
77
+ }
68
78
  messageInstance = notification;
69
79
  notification.notice({
70
80
  duration: duration,
@@ -124,6 +134,8 @@ exports['default'] = {
124
134
  if (messageInstance) {
125
135
  messageInstance.destroy();
126
136
  messageInstance = null;
137
+ } else {
138
+ messageNeedHide = true;
127
139
  }
128
140
  },
129
141
  config: function config() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "2.3.0",
3
+ "version": "2.3.4",
4
4
  "description": "基于 React 的移动设计规范实现",
5
5
  "homepage": "http://mobile.ant.design",
6
6
  "keywords": [