…lines 1–174 unchanged (174 lines)
175 update(tagDefinitions, activeTagDefinition, tagData, false);
176 }
177
178 function handleChange(event: React.SyntheticEvent<HTMLInputElement | HTMLSelectElement>) {
179 let argIndex = -1;
180 if (event.currentTarget.parentNode instanceof HTMLElement) {
181 const index = event.currentTarget.parentNode?.getAttribute('data-arg-index');
182 argIndex = typeof index === 'string' ? parseInt(index, 10) : -1;
183 }
184 // Handle special types
185 if (event.currentTarget.getAttribute('data-encoding') === 'base64') {
186 return updateArg(templateUtils.encodeEncoding(event.currentTarget.value, 'base64'), argIndex);
187 }
188 // Handle normal types
189 if (event.currentTarget.type === 'number') {
190 return updateArg(parseFloat(event.currentTarget.value), argIndex);
191 } else if (event.currentTarget.type === 'checkbox') {
192 return updateArg((event.currentTarget as HTMLInputElement).checked, argIndex);
193 }
194 return updateArg(event.currentTarget.value, argIndex);
195 }
196 async function update(
…lines 197–252 unchanged (56 lines)
253 finalPreview = preview.replace(/./g, '*');
254 }
255 let previewElement;
256 if (error) {
257 // detects a string to replace with a link to settings
258 const linkText = 'Insomnia Preferences → Security';
259 if (error.endsWith(linkText)) {
260 previewElement = (
261 <div className="danger min-h-[115px] rounded-md border border-solid border-(--hl-md) bg-(--hl-xxs) p-(--padding-sm)">
262 {error.slice(0, error.length - linkText.length)}
263 <Link
264 className="cursor-pointer text-(--color-surprise)"
265 onPress={() => {
266 props.close();
267 showSettingsModal({ tab: 'general' });
268 }}
269 >
270 {linkText}
271 </Link>
272 </div>
273 );
274 } else {
275 previewElement = <textarea className="danger" value={error || 'Error'} readOnly rows={5} />;
276 }
277 } else if (rendering) {
278 previewElement = <textarea value="rendering..." readOnly rows={5} />;
279 } else {
280 previewElement = <textarea value={finalPreview || 'error'} readOnly rows={5} />;
281 }
282
…lines 283–640 unchanged (358 lines)