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() {
|
export function isOTAEnabled() {
|
||||||
return import.meta.env.VITE_ENABLE_OTA === 'true';
|
return import.meta.env.VITE_ENABLE_OTA === 'true' || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isTrialMode() {
|
export function isTrialMode() {
|
||||||
return import.meta.env.VITE_TRIAL_MODE === "true"
|
return import.meta.env.VITE_TRIAL_MODE === "true" || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTrialDate() {
|
export function getTrialDate() {
|
||||||
|
|
|
@ -448,6 +448,9 @@ export const useDataViewerStore = defineStore('text-viewer', () => {
|
||||||
|
|
||||||
const textPrefixValue = ref("")
|
const textPrefixValue = ref("")
|
||||||
const textSuffixValue = ref("\\r\\n")
|
const textSuffixValue = ref("\\r\\n")
|
||||||
|
const hasAddedText = computed(() => {
|
||||||
|
return textPrefixValue.value.length > 0 || textSuffixValue.value.length > 0;
|
||||||
|
});
|
||||||
|
|
||||||
const uartBaud = ref(115200);
|
const uartBaud = ref(115200);
|
||||||
const uartBaudReal = ref(115200);
|
const uartBaudReal = ref(115200);
|
||||||
|
@ -715,6 +718,7 @@ export const useDataViewerStore = defineStore('text-viewer', () => {
|
||||||
softRefreshFilterBuf,
|
softRefreshFilterBuf,
|
||||||
textSuffixValue,
|
textSuffixValue,
|
||||||
textPrefixValue,
|
textPrefixValue,
|
||||||
|
hasAddedText,
|
||||||
clearByteCount,
|
clearByteCount,
|
||||||
dataBufLength,
|
dataBufLength,
|
||||||
configPanelTab,
|
configPanelTab,
|
||||||
|
|
|
@ -95,8 +95,8 @@ const macroData: Ref<macroItem[]> = ref([
|
||||||
|
|
||||||
|
|
||||||
function onSendClick(val: string) {
|
function onSendClick(val: string) {
|
||||||
if (!val) {
|
if (!val && !store.hasAddedText) {
|
||||||
globalNotify("发送框无数据发送")
|
globalNotify("无帧头帧尾、发送框无数据发送")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -469,8 +469,8 @@ function handleTextboxKeydown(ev: KeyboardEvent) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSendClick() {
|
function onSendClick() {
|
||||||
if (!uartInputTextBox.value) {
|
if (!uartInputTextBox.value && !store.hasAddedText) {
|
||||||
globalNotify("发送框无数据发送")
|
globalNotify("无帧头帧尾、发送框无数据发送")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue