Disallow snake_case variable names in frontend

This commit is contained in:
Keavon Chambers
2021-08-12 21:43:50 -07:00
parent 35d7fe8860
commit 47af8d9bed
8 changed files with 29 additions and 46 deletions

View File

@@ -108,25 +108,25 @@ export default defineComponent({
},
async updatePrimaryColor() {
const { update_primary_color, Color } = await wasm;
const { Color } = await wasm;
let color = this.primaryColor;
const button = this.getRef<HTMLButtonElement>("primaryButton");
button.style.setProperty("--swatch-color", `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})`);
color = rgbToDecimalRgb(this.primaryColor);
update_primary_color(new Color(color.r, color.g, color.b, color.a));
(await wasm).update_primary_color(new Color(color.r, color.g, color.b, color.a));
},
async updateSecondaryColor() {
const { update_secondary_color, Color } = await wasm;
const { Color } = await wasm;
let color = this.secondaryColor;
const button = this.getRef<HTMLButtonElement>("secondaryButton");
button.style.setProperty("--swatch-color", `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})`);
color = rgbToDecimalRgb(this.secondaryColor);
update_secondary_color(new Color(color.r, color.g, color.b, color.a));
(await wasm).update_secondary_color(new Color(color.r, color.g, color.b, color.a));
},
},
data() {

View File

@@ -46,13 +46,12 @@ export default defineComponent({
// and updating a widget should send the whole updated struct to the backend.
// Later, it could send a single-field update to the backend.
const { set_tool_options } = await wasm;
// This is a placeholder call, using the Shape tool as an example
set_tool_options(this.$props.activeTool || "", { Shape: { shape_type: { Polygon: { vertices: newValue } } } });
// eslint-disable-next-line camelcase
(await wasm).set_tool_options(this.$props.activeTool || "", { Shape: { shape_type: { Polygon: { vertices: newValue } } } });
},
async sendToolMessage(message: string | object) {
const { send_tool_message } = await wasm;
send_tool_message(this.$props.activeTool || "", message);
(await wasm).send_tool_message(this.$props.activeTool || "", message);
},
handleIconButtonAction(option: IconButtonWidget) {
if (option.message) {