fix(send) msg not sent if msg empty but frame suffix/prefix not empty
This commit is contained in:
parent
5b9d6f878f
commit
8a84b215a7
|
@ -3,11 +3,11 @@ export function isDevMode() {
|
|||
}
|
||||
|
||||
export function isOTAEnabled() {
|
||||
return import.meta.env.VITE_ENABLE_OTA === 'true';
|
||||
return import.meta.env.VITE_ENABLE_OTA === 'true' || false;
|
||||
}
|
||||
|
||||
export function isTrialMode() {
|
||||
return import.meta.env.VITE_TRIAL_MODE === "true"
|
||||
return import.meta.env.VITE_TRIAL_MODE === "true" || false;
|
||||
}
|
||||
|
||||
export function getTrialDate() {
|
||||
|
|
|
@ -448,6 +448,9 @@ export const useDataViewerStore = defineStore('text-viewer', () => {
|
|||
|
||||
const textPrefixValue = ref("")
|
||||
const textSuffixValue = ref("\\r\\n")
|
||||
const hasAddedText = computed(() => {
|
||||
return textPrefixValue.value.length > 0 || textSuffixValue.value.length > 0;
|
||||
});
|
||||
|
||||
const uartBaud = ref(115200);
|
||||
const uartBaudReal = ref(115200);
|
||||
|
@ -715,6 +718,7 @@ export const useDataViewerStore = defineStore('text-viewer', () => {
|
|||
softRefreshFilterBuf,
|
||||
textSuffixValue,
|
||||
textPrefixValue,
|
||||
hasAddedText,
|
||||
clearByteCount,
|
||||
dataBufLength,
|
||||
configPanelTab,
|
||||
|
|
|
@ -95,8 +95,8 @@ const macroData: Ref<macroItem[]> = ref([
|
|||
|
||||
|
||||
function onSendClick(val: string) {
|
||||
if (!val) {
|
||||
globalNotify("发送框无数据发送")
|
||||
if (!val && !store.hasAddedText) {
|
||||
globalNotify("无帧头帧尾、发送框无数据发送")
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -469,8 +469,8 @@ function handleTextboxKeydown(ev: KeyboardEvent) {
|
|||
}
|
||||
|
||||
function onSendClick() {
|
||||
if (!uartInputTextBox.value) {
|
||||
globalNotify("发送框无数据发送")
|
||||
if (!uartInputTextBox.value && !store.hasAddedText) {
|
||||
globalNotify("无帧头帧尾、发送框无数据发送")
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue