Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onCloseShareLink = async (doc: string) => {
const result = await updateShare(doc, false);
if (result) {
const { height } = Dimensions.get('window');
let toast = Toast.show('リンクを非公開にしました', {
duration: Toast.durations.LONG,
//textColor: "red",
position: height - 150,
shadow: true,
animation: true,
hideOnPress: true,
delay: 0,
});
// You can manually hide the Toast, or it will automatically disappear after a `duration` ms timeout.
setTimeout(function() {
Toast.hide(toast);
}, 3000);
}
};
toast(message, param, duration) {
duration = duration || 'LONG';
// Add a Toast on screen.
let toast = Toast.show(message, {
duration: Toast.durations[duration.toUpperCase()],
position: Toast.positions.BOTTOM,
shadow: true,
animation: true,
hideOnPress: true,
delay: 0
});
}
showWarning: (msg, options) => {
let toast = RootToast.show(
Platform.OS === 'ios' ?
: msg, {
duration: RootToast.durations.SHORT,
position: RootToast.positions.CENTER,
...options,
})
setTimeout(function () {
RootToast.hide(toast)
}, RootToast.durations.SHORT + 500)
},
onFavouritePressed(accountId, personaName, avatar) {
var index = -1;
for(let i = 0; i < this.props.favourites.length; i++) {
if(this.props.favourites[i].account_id == accountId) {
index = i;
}
}
if(index == -1) {
var info = {};
info.account_id = accountId;
info.avatarfull = avatar;
info.personaname = personaName;
this.props.favouritesActions.addFavourites(info);
let toast = Toast.show('Added to Favourites', {
duration: Toast.durations.SHORT,
position: Toast.positions.BOTTOM,
shadow: true,
animation: true,
hideOnPress: true,
delay: 0
});
setTimeout(function () {
Toast.hide(toast);
}, 2000);
} else {
this.props.favouritesActions.removeFavourites(accountId);
let toast = Toast.show('Removed from Favourites', {
duration: Toast.durations.SHORT,
position: Toast.positions.BOTTOM,
shadow: true,
animation: true,
function dispatchWindow(action: AnyAction) {
try {
const win = remote.getCurrentWindow();
const data = JSON.stringify(action);
win.webContents.send("dispatch", data);
} catch (e) {
Toast.show(e.message || JSON.stringify(e, null, 2), {
...toastOptions,
duration: Toast.durations.SHORT
});
}
}
const showLong = (content) => {
if (!content) {
return;
}
if (Platform.OS === 'ios') {
Toast.show(content.toString(), {
duration: Toast.durations.LONG,
position: Toast.positions.BOTTOM,
shadow: true,
animation: true,
hideOnPress: true,
delay: 0,
});
} else {
ToastAndroid.show(content.toString(), ToastAndroid.LONG);
}
};
export const toastLong = (content) => {
if (toast !== undefined) {
Toast.hide(toast);
}
toast = Toast.show(content.toString(), {
duration: Toast.durations.LONG,
position: Toast.positions.BOTTOM,
shadow: true,
animation: true,
hideOnPress: true,
delay: 0
});
};
Toast.show('标题不可为空!', {
duration: Toast.durations.SHORT,
position: Toast.positions.CENTER,
})
return
}
if (!this.state.description) {
Toast.show('描述不可为空!', {
duration: Toast.durations.SHORT,
position: Toast.positions.CENTER,
})
return
}
if (!this.state.assigneeName) {
Toast.show('请指定指给谁!', {
duration: Toast.durations.SHORT,
position: Toast.positions.CENTER,
})
return
}
let BaseParams = {}
BaseParams = {
fields: {
issuetype: {
name: 'Bug',
},
project: {
key: this.state.projectData[0],
},
summary: this.state.summary,
assignee: {
name: this.state.assigneeName[0],
static showLongBottom(message) {
let toast = Toast.show(message, {
duration: Toast.durations.LONG,
position: Toast.positions.BOTTOM,
shadow: true,
animation: true,
textStyle: {
fontSize: AppConfig.TEXT_SIZE_SMALL
},
hideOnPress: true,
backgroundColor: BC,
delay: 0,
containerStyle: {
paddingVertical: AppConfig.DISTANCE_SAFE / 2,
paddingHorizontal: AppConfig.DISTANCE_SAFE,
marginBottom: IphoneXUtil.isIphoneX() ? 50 + IphoneXUtil.iphoneXBottom() : 50,
}
});
}
const showShort = (content) => {
if (!content) {
return;
}
if (Platform.OS === 'ios') {
Toast.show(content.toString(), {
duration: Toast.durations.SHORT,
position: Toast.positions.BOTTOM,
shadow: true,
animation: true,
hideOnPress: true,
delay: 0,
});
} else {
ToastAndroid.show(content.toString(), ToastAndroid.SHORT);
}
};