// Copyright (c) 2022, JINGROW
// For license information, please see license.txt

jingrow.ui.form.on("Error Log", {
	refresh: function (frm) {
		frm.disable_save();

		if (frm.pg.reference_pagetype && frm.pg.reference_name) {
			frm.add_custom_button(__("Show Related Errors"), function () {
				jingrow.set_route("List", "Error Log", {
					reference_pagetype: frm.pg.reference_pagetype,
					reference_name: frm.pg.reference_name,
				});
			});
		}
	},
});
